How many rows does the join return?
-- a.id: 1, 2, 3 -- b.id: 2, 3, 4 SELECT * FROM a JOIN b ON a.id = b.id;
- 2
- 4
- 6
- 3
An inner join keeps only matching keys, and only 2 and 3 appear in both tables.
Play SQL & Databases ▸
-- a.id: 1, 2, 3 -- b.id: 2, 3, 4 SELECT * FROM a JOIN b ON a.id = b.id;