Write a solution to find managers with at least five direct reports.
Return the result table in any order.
WITH DirectReportsCount AS (
SELECT managerId, COUNT(*) AS directReports
FROM Employee
GROUP BY managerId
HAVING COUNT(*) >= 5
)
SELECT E1.name
FROM Employee E1
JOIN DirectReportsCount E2 ON E1.id = E2.managerId