$ ./guess_the_languageSQL & Databases
SQL & Databases · medium · #11

How many rows does this return?

-- a.id: 1, 2, 3
-- b.id: 2, 3, 4
SELECT * FROM a
FULL OUTER JOIN b ON a.id = b.id;
  1. 6
  2. 4
  3. 2
  4. 3
Matches 2 and 3 give two rows, plus unmatched 1 from the left and 4 from the right, padded with NULLs.
Play SQL & Databases ▸