[SQL문제풀기] Managers with at Least 5 Direct Reports

silver's avatar
Oct 20, 2025
[SQL문제풀기] Managers with at Least 5 Direct Reports
Contents
문제MySQL

문제

MySQL

내가 작성한 정답

: where이 좀 더 빠르다
select name from Employee where id in (select managerId from Employee group by managerId having count(id) >= 5);
select b.name from Employee b left join Employee e on b.id = e.managerId group by b.id having count(e.id) >= 5;
notion image
notion image
 
Share article

silver