Skip to main content
Module 5 · Lesson 3 of 419/57 in the course~14 min
Module lessons (3/4)

OUTER JOIN: Finding the Gaps

Lesson preview5 hands-on exercises readySQL Course · Module 5 — Advanced JOINs

Use LEFT, RIGHT, and FULL OUTER JOINs to find unmatched or missing records.

What you'll learn in this lesson

  • Master LEFT, RIGHT, and FULL OUTER JOIN (the word OUTER is optional).
  • Construct the anti-join (LEFT JOIN ... WHERE right.id IS NULL) pattern to discover orphaned records and "holes" in the data.
  • Correctly place the filters between ON and WHERE without canceling the effects of the outer join.

Overview

Often the most valuable questions in a business concern what is missing: "which products have not even received a review?", "which registered customers have never bought?", "are there employees without departments and departments without employees?".

All these controls arise from the OUTER JOIN variants: keep the unmatched rows by transforming their counterpart into NULL.

Sections covered in this lesson

  1. 11. Mental Model: The Three Variants OUTER + Anti-Join
  2. 22. Progressive & Annotated Examples
  3. 33. Interactive Laboratory: Anti-Join, RIGHT and FULL OUTER
  4. 44. Diagnostic Verification (Quiz)
  5. 55. Progressive Practical Laboratory
Pro Lesson · Module 5 — Advanced JOINs

Unlock "OUTER JOIN: Finding the Gaps" and the full SQL Course curriculum

Use LEFT, RIGHT, and FULL OUTER JOINs to find unmatched or missing records.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in SQL Course plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.