101
0/304
Loading content...
You are analyzing an organizational directory where each employee may report to one direct manager.
The table schema is:
Column meanings:
Task: Return the names of managers who have at least 5 direct reports.
Important details:
Supported submission formats:
Employee:
| id | name | department | managerId |
|-----|-------|------------|-----------|
| 101 | John | A | NULL |
| 102 | Dan | A | 101 |
| 103 | James | A | 101 |
| 104 | Amy | A | 101 |
| 105 | Anne | A | 101 |
| 106 | Ron | B | 101 |[
{"name":"John"}
]John (id=101) has five direct reports, so John is included.
Employee:
| id | name | department | managerId |
|----|-------|------------|-----------|
| 1 | Maya | Sales | NULL |
| 2 | Riley | Sales | 1 |
| 3 | Sam | Sales | 1 |
| 4 | Nia | Sales | 1 |
| 5 | Lee | Sales | 1 |[]Maya has only four direct reports, so no manager meets the >= 5 requirement.
Employee:
| id | name | department | managerId |
|----|--------|------------|-----------|
| 10 | Avery | Ops | NULL |
| 11 | Kai | Ops | 10 |
| 12 | Noor | Ops | 10 |
| 13 | Jae | Ops | 10 |
| 14 | Uma | Ops | 10 |
| 15 | Inez | Ops | 10 |
| 50 | Ghost | X | 9999 |[
{"name":"Avery"}
]Avery qualifies with five direct reports. The managerId=9999 row does not create a manager output because no employee has id 9999.
Constraints