Return
manager_name: the name of the managerdepartment_name: the name of the manager's departmenttotal_reports: the total number of employees reporting (directly or indirectly) to the managerdepartment_name (A-Z), then manager_name (A-Z).Expected output
| manager_name | department_name | total_reports |
|---|---|---|
| 1 row — values hidden, that's the puzzle | ||
Your query should return 1 row with these columns. Your column aliases don't need to match.
departments
| id | name |
|---|---|
| 1 | Engineering |
| 2 | Sales |
| 3 | Marketing |
| 4 | Operations |
employees
| id | name | department_id | manager_id | salary | hired_on |
|---|---|---|---|---|---|
| 1 | Ana Reyes | 1 | NULL | 150000 | 2018-03-01 |
| 2 | Ben Cho | 1 | 1 | 120000 | 2019-06-15 |
| 3 | Cara Diaz | 1 | 1 | 120000 | 2020-01-20 |
| 4 | Dan Ellis | 2 | NULL | 140000 | 2017-11-05 |
| 5 | Eve Fox | 2 | 4 | 95000 | 2021-02-10 |
0 of 4 hints revealed
Submit an attempt first.