Chapter 6 · Lesson 1 of 7
Why JOINs Exist
Understand why normalized data lives in separate tables and how JOINs reconnect related rows through matching key columns.
When a database is normalized, related facts live in different tables. That keeps the data clean, but it also means you need a way to bring those facts back together when you query.
That is what JOIN does. It combines rows from two tables based on a matching key.
For example, employees.department_id points to departments.id. The employees table knows which department an employee belongs to, and the departments table knows the department name. A JOIN lets you combine both facts into one result.
The most important thing in a JOIN is the matching condition:
ON employees.department_id = departments.idIf you understand which columns connect the tables, the rest of the JOIN becomes much easier to reason about.
This lesson is theory-focused. Read it, then mark it complete in the Learn SQL panel before moving on.
Open this lesson in the SQL editorLessons in JOIN Types
Combine related tables with INNER, LEFT, RIGHT, FULL OUTER, SELF, and CROSS JOIN, and find rows that have no match.