One list has students and their class IDs, another has class IDs and room numbers — join them to learn which room each student sits in. A JOIN cross-references tables, and normalization keeps each fact in one place so it never contradicts itself.
Relate, don't repeat
Relational databases split data across tables to avoid repetition, then recombine it with joins. An INNER JOIN matches rows from two tables where a shared key is equal — for example, linking an orders table to a customers table by customer_id — returning only rows that match in both.
Normalization organizes tables so each fact is stored once. Instead of repeating a customer's address on every order, you store it once in a customers table and reference it by key — reducing redundancy and update anomalies.
SELECT o.id, c.name FROM orders o JOIN customers c ON o.customer_id = c.id; — pairs each order with its customer's name.
- Imagine storing each customer's full address on every one of their orders.
- Consider what happens when the customer moves.
- Explain how splitting into two tables plus a join fixes it.
What you should see: One big table repeats the address and risks inconsistent updates; storing it once in a customers table and joining keeps a single source of truth.