WeCodeAcademy

INNER JOIN

Related data lives in different tables. The orders table stores a customer_id rather than a name. A JOIN lines up rows from two tables on matching values.

Examplesql
Open in editor »

ON says how the tables match. Short aliases keep it readable:

Examplesql
Open in editor »
Quick check

What does the `ON` part of a join do?

Your turn: write the code

List the names of customers who ordered the product called Headphones, sorted by name. You will need to join three tables.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.