Easy SELECT & filtering Free

SQL interview question: Employees Without a Manager

Employees Without Managers

HR discovered some employee records have NULL in the manager_id field, indicating either top executives or data quality issues.

Find all employees who don't have a manager assigned (manager_id IS NULL).

Return employee_id, name (full name), and department_id. These are top executives.

Skills: NULL handling with IS NULL operator

Tables

employees 37 rows
  • id integer PK
  • first_name text
  • last_name text
  • email text
  • department_id integer → departments
  • salary integer
  • hire_date text
  • manager_id integer → employees
  • title text
idfirst_namelast_nameemaildepartment_idsalaryhire_datemanager_idtitle
1AliceChen[email protected]12500002015-01-15NULLCEO
2RobertMartinez[email protected]21800002016-03-20NULLCEO
3SarahJohnson[email protected]11500002017-06-101VP Engineering

Keep going