Question: Find the id and name of the staff who has been assigned for the shortest period.
Schema: create table staff_department_assignments (staff_id varchar, PRIMARY KEY (staff_id)); create table staff (staff_id varchar, staff_name varchar, PRIMARY KEY (staff_id))
SQL: select t1.staff_id, t1.staff_name from staff as t1 join staff_department_assignments as t2 on t1.staff_id = t2.staff_id order by date_assigned_to - date_assigned_from limit 1