Skip to main content
SQL โ€ข LESSON 87

LEFT JOIN Missing Matches

How can we find employees who have no department?

Advancedโฑ 3 Minutesโญ 1000 XP
๐Ÿค” THE QUESTION

How can we find employees who have no department?

๐Ÿ’ก WHAT IS IT?

Filtering for IS NULL on the right table's primary key after a LEFT JOIN isolates unmatched records.

๐ŸŽฏ WHAT IS IT USED FOR?

Orphan record detection, unassigned employee auditing, missing reference cleanup.

๐Ÿ’ป EXAMPLE
SELECT e.name
FROM employees e
LEFT JOIN departments d
ON e.department_id = d.department_id
WHERE d.department_id IS NULL;

๐ŸŽฏ Mission Objectives

Practice typing production-grade SQL code for LEFT JOIN Missing Matches.

  • โœ“ IS NULL check
  • โœ“ Orphan detection
  • โœ“ Data quality auditing
  • โœ“ LEFT JOIN filtering