Skip to main content
SQL • LESSON 87

LEFT JOIN Missing Matches

How can we find employees who have no department?

Advanced3 Minutes1000 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