List all staff names with their gender...
select staff_name, staff_gender from staff
List all department id's with their corresponding job title code.
select department_id, job_title_code from staff_department_assignments
How many staffs are working as Sales Person or Clerical Staff?
select count ( * ) from staff as t1 join staff_department_assignments as t2 on t1.staff_id = t2.staff_id where t2.job_title_code = "Sales Person" or t2.job_title_code = "Clerical Staff"
Find the id and name of the staff who has been assigned for the shortest period.
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