Question: What is first names of the top 5 staff who have handled the greatest number of complaints?
Schema: create table complaints (staff_id varchar, PRIMARY KEY (staff_id)); create table staff (first_name varchar, staff_id varchar, PRIMARY KEY (first_name))
SQL: select t1.first_name from staff as t1 join complaints as t2 on t1.staff_id = t2.staff_id group by t2.staff_id order by count(*) limit 5