SQL Dojo Beta
Pitfall

COUNT(*) vs COUNT(column)

COUNT(column) skips NULLs; COUNT(*) counts rows.

To count rows, use COUNT(*). Use COUNT(column) only when you mean "rows where this column is filled", and COUNT(DISTINCT column) for distinct values.

SELECT COUNT(*) AS all_rows,
       COUNT(city) AS with_city,
       COUNT(DISTINCT city) AS cities
FROM customers;
all_rowswith_citycities
40038227
Try it in Randori