CS FundamentalsModerateGATE CS · TCS Digital

S(v) has rows 1, 2, 3 and U(v) has rows 2, NULL. What does SELECT COUNT(*) FROM S WHERE v NOT IN (SELECT v FROM U) return?

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

Correct answer: B. 0

For v = 1 and v = 3, 'v <> NULL' is UNKNOWN, so NOT IN is never TRUE and no row qualifies; v = 2 is excluded directly.

More DBMS and SQL questions

Exams that ask this topic