← Back to archive

Stdle #50 · aggregates · 2026-07-26

What does this SQL snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

CREATE TABLE t(n INTEGER);
INSERT INTO t VALUES (10),(20),(NULL),(30);
SELECT COUNT(*), COUNT(n), SUM(n), AVG(n) FROM t
Aggregates
4 attempts left

Answer & explanation