$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #226

What does the final query return?

CREATE TABLE t (x INT);
INSERT INTO t VALUES (1), (NULL), (3);
SELECT COUNT(*), COUNT(x) FROM t;
  1. 3 | 2
  2. 3 | 3
  3. 2 | 2
  4. 2 | 3
COUNT(*) counts rows; COUNT(x) skips rows where x is NULL.
Play Problem Solving ▸