Each employee's level in the hierarchy
In the org chart emp (employee → manager via manager_id), compute each one's level: the topmost (no manager) is level 1, their reports are 2, and so on down. Return id and depth, ordered by id.
Exemplu de ieșire așteptată
Așa arată un răspuns corect — numărul său de rânduri îi este propriu, nu trebuie să se potrivească cu tabelele din schemă.
| id | depth |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 2 |
Conectează-te pentru a vedea istoricul soluțiilor trimise
Conectează-teConectează-te pentru a folosi Mentorul AI
Conectează-te