NewThe ManyPI MCP Server is now live

Joining tables in SQL

What INNER JOIN and LEFT JOIN return, worked through on a small shop database. Match, choose and complete.

Exercise15 minBachelor +2CC BY 4.0
3 tasks · 15 min

What you will learn

  • Explain what a join does with two tables
  • Tell INNER JOIN and LEFT JOIN apart by their result
  • Write the ON condition that links two tables

The shop database has customers (id, name) and orders (id, customer_id, order_date). Every order's customer_id points at one customer's id. Eight customers, ten orders, and one customer, Hannah Wolf, has never ordered. You can run every query in the SQL sandbox with the shop dataset.

Use it with a class
  1. 1. Copy the class link and share it with your class.
  2. 2. Learners finish the exercise and get a result code.
  3. 3. Paste the codes into Class results to see everyone at once.

Reuse this material

CC BY 4.0

You may copy, adapt and share it, also commercially, as long as you credit ManyPI and link back.

"Joining tables in SQL" by ManyPI (https://manypi.com/edu/sql-joins-exercise), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)