Show the employee names with their corresponding counts of aircraft certificates.
select t1.name, count(*) from employee as t1 join certificate as t2 on t1.eid = t2.eid group by t1.eid
Order the employees by these counts.
select t1.name, count(*) from employee as t1 join certificate as t2 on t1.eid = t2.eid group by t1.eid order by count(*)
Who has the most certificates?
select t1.name from employee as t1 join certificate as t2 on t1.eid = t2.eid group by t1.eid order by count(*) desc limit 1
what is the name and salary of this employee?
select t1.name, t1.salary from employee as t1 join certificate as t2 on t1.eid = t2.eid group by t1.eid order by count(*) desc limit 1