beginner~4h

JOINs — INNER, LEFT, RIGHT, FULL, SELF, CROSS

JOINs combine rows from two or more tables based on a related column. Understanding which JOIN to use and how it executes is fundamental to SQL mastery.

Learning objectives

  • Predict exactly which rows a query returns for INNER, LEFT, RIGHT, and FULL joins on two given tables.
  • Explain, precisely, why putting a filter in ON versus WHERE can change a LEFT JOIN's results.
  • Recognize when a SELF JOIN is the right tool, and write one correctly.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

JOINs — INNER, LEFT, RIGHT, FULL, SELF, CROSS

Next Step

Continue to Subqueries, EXISTS & Correlated Subqueries← Back to all SQL chapters