Learning on Web Dev Open is free for all.

ArcadeJoin Room
Arcade

Join Room

Phase 05 · Backend EngineeringPlayable

Two tables, one exact result. Pick the join, and where the filter goes.

0 / 5 cleared
Level 1 · Only the matches

Every order, with the name of the customer who placed it. Orders belonging to nobody should not appear, and customers with no orders should not either.

users u
idname
1Ada
2Grace
3Alan
orders o
iduser_idtotalstatus
11140paid
12125refunded
13290paid
14910paid
Your query
SELECT *
FROM users u
INNER JOIN orders o
  ON u.id = o.user_id
Your result3 rows · matches
u.idu.nameo.ido.user_ido.totalo.status
1Ada11140paid
1Ada12125refunded
2Grace13290paid
Target3 rows
u.idu.nameo.ido.user_ido.totalo.status
1Ada11140paid
1Ada12125refunded
2Grace13290paid

INNER keeps only rows that matched. Notice what it silently removed: Alan, who has never ordered, and order 14, whose user_id points at a customer that does not exist. Both are the kind of thing you want to know about.

The result table is computed from the rows above it by the same rules a database applies, so the query printed here would produce exactly these rows against exactly these tables.