A · Query · beginner · Week 1–2 · Chapter 4 of 12
JOINs — inner, left, and relationships
Relational power: combine tables on keys. INNER JOIN keeps matches. LEFT JOIN keeps all left rows.
Path progress28%
Step 1 of 3
INNER JOIN
customers INNER JOIN orders ON customers.id = orders.customer_id — only customers with orders.
Example
SELECT o.id, c.name, o.total
FROM orders o
INNER JOIN customers c ON c.id = o.customer_id;Do this now
SQLBolt lessons 6–8. List order id, customer name, total for each order.
Was this step clear?
Chapter learning outcomes
- INNER JOIN
- LEFT JOIN
- Join conditions
- Table aliases
Clear these before you leave
Side quest
Join diagram
Sketch ER diagram for your sandbox tables on paper.