Skip to main content

INNER JOIN

An inner join returns rows where the join keys match in both tables.

Watch

Video coming soon

Learn

SELECT o.order_id, c.email, o.amount
FROM orders AS o
INNER JOIN customers AS c
ON o.customer_id = c.customer_id;

Checklist:

  • Join on keys that mean the same thing (ids, not free text when you can avoid it).
  • Alias tables (o, c) so column names stay readable.
  • Watch fan-out: one customer to many orders multiplies rows — that is often correct.

Check

Check understanding

What does INNER JOIN keep?
Which are good INNER JOIN habits?

Select all that apply

Discussion

Comments

Share feedback or questions about this page. No account required.

Loading comments…