CS FundamentalsHardCapgemini · Cognizant GenC

A(k) holds 1, 2, 3 and B(k, v) holds (1, NULL), (2, 5). How many rows does SELECT * FROM A LEFT JOIN B ON A.k = B.k WHERE B.v IS NULL return?

  1. A. 1
  2. B. 3
  3. C. 0
  4. D. 2

Correct answer: D. 2

Key 1 matches B but its v is NULL, so it passes the filter; key 3 has no match, so its v is NULL as well. Key 2 fails. Total 2 rows.

More DBMS and SQL questions

Exams that ask this topic