How many people report to a manager
For each manager in emp, count how many people are under them across all levels — direct and indirect reports. Return the manager id and the count reports, only for those with at least one report, ordered by id.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| id | reports |
|---|---|
| 1 | 6 |
| 2 | 3 |
| 3 | 1 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in