$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #235

What does the final query return?

CREATE TABLE t (x INT);
INSERT INTO t VALUES (2), (3);
SELECT COUNT(*) FROM t WHERE x NOT IN (1, NULL);
  1. 2
  2. 0
  3. 1
  4. NULL
x <> NULL is unknown, so NOT IN with a NULL in the list is never true and no row qualifies.
Play Problem Solving ▸