Identify managers and how many direct reports each has by self-joining the Employee table on ReportsTo.
| Column | Type |
|---|---|
| EmployeeId | INTEGER (PK) |
| LastName | TEXT NOT NULL |
| FirstName | TEXT NOT NULL |
| Title | TEXT |
| ReportsTo | INTEGER (FK → Employee) |
| BirthDate | TIMESTAMP |
| HireDate | TIMESTAMP |
| Country | TEXT |
ManagerName, ManagerTitle, DirectReportsReady to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.