5명 이상의 직속 부하 직원이 있는 관리자를 찾아라
SELECT name
FROM Employee
WHERE id IN (
SELECT managerId
FROM Employee
GROUP BY managerId
HAVING COUNT(*) >= 5)
SELECT m.name
FROM employee as e
INNER JOIN employee as m
ON e.managerId=m.id
GROUP BY e.managerId
HAVING COUNT(m.id)>=5