Aggregation & GROUP BY
Exercise · SQL & Querying

Predict, then run it

Predict the output

ballots(voter, choice) = (1,A),(2,NULL),(3,A),(4,B). Predict all three counts:

SELECT COUNT(*), COUNT(choice), COUNT(DISTINCT choice) FROM ballots;

Predict the exact output.