TheAnalyst / SQLAll lessons ↗
Day 12 · Aggregation & joins · 10–20 minutes

INNER JOIN

JOIN combines matching rows from related tables.

01 · Learn

The idea

JOIN combines matching rows from related tables. Read the query line by line and identify the input table, the transformation, and the shape of the result before running it.

SELECT o.order_id, c.name, o.amount FROM orders o JOIN customers c ON c.customer_id = o.customer_id ORDER BY o.order_id;
Read it actively

Before running the example, predict the output columns and whether the query returns one row, many rows, or possibly no rows.

02 · Recall

Explain it without looking

In your own words, explain the main SQL feature in today’s lesson and why it answers the question.

03 · Solve

Run your own query

Show every order with the customer's name and order amount.

Loading browser SQL engine…
04 · Repeat

Close the loop