HR wants to identify individual contributors -- employees nobody reports to. Using a correlated NOT EXISTS subquery against Employee itself, find every employee with zero direct reports.
Return EmployeeId, FirstName, LastName, and Title, ordered by EmployeeId ascending.
| Column | Type |
|---|---|
| EmployeeId | INTEGER (Primary Key) |
| ReportsTo | INTEGER (Foreign Key -> Employee.EmployeeId, nullable) |
Ready 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.