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.
Esempio di output atteso
Ecco come appare una risposta corretta — il suo numero di righe è a sé stante, non deve corrispondere alle tabelle dello schema.
| id | reports |
|---|---|
| 1 | 6 |
| 2 | 3 |
| 3 | 1 |
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
Accedi