A walkthrough of an SQL interview problem that requires counting the number of employees managed by each manager. The solution uses a self join on an employee table, joining the manager_id column back to the id column of the same table to resolve manager names, then groups by manager and counts employees. The tutorial covers why self joins are the natural fit for hierarchical employee-manager relationships and how to handle NULL managers using inner vs left joins.

6m watch time
1 Impression