HR wants to identify managers with large teams. An employee reports directly to the person whose id is in their manager_id. Only managers who exist as employees can be reported, so a manager_id that does not match any employee is ignored. Write an SQL query that returns the name of every manager with at least 5 direct reports. Order the results by name ascending.
Loading…
Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.
Ask questions, share alternate queries, and explore solutions
Your recent query executions and answer checks
This will insert the verified MySQL solution into your editor so you can study how each clause transforms the table.