In PostgreSQL 18, a column x holds the values NULL, NULL, 1, 1 and 2. How many rows does SELECT x, count(*) FROM ... GROUP BY x; return?
Explanation
All rows whose grouping column is null land in a single group, so the groups are NULL, 1 and 2, and the null group reports a count of 2. Answering 4 applies the rule that NULL = NULL is not true to grouping, but grouping does not use the = operator.