Find Employee With Most Direct Reports
Find the employee who has the most direct reports.
sql
SELECT manager_id, COUNT(*) AS report_count FROM employees WHERE manager_id IS NOT NULL GROUP BY manager_id ORDER BY report_count DESC LIMIT 1;
This query groups the "employees" table by "manager_id", counts the number of occurrences for each manager, and returns the manager with the highest count of direct reports.
PromptDB can make mistakes. Please double-check responses.