COUNT(*) vs COUNT(column)
BeginnerNULLs, COUNT(col)Earthquakes (USGS, Oct 2026)
Return two numbers in one row: the total row count, and the number of rows where horizontal_error is not missing.
Solution
SELECT COUNT(*), COUNT(horizontal_error) FROM quakes;Expected output:
Hint
COUNT(column) skips NULLs; COUNT(*) does not.
Same question in Excel / Google Sheets
=COUNTA(A2:A2629) vs =COUNT(N2:N2629): COUNT skips blank cells.
Download the CSV from the datasets page. Column letters assume the CSV opens with its header in row 1.
Tip: Ctrl+Enter (⌘+Enter on Mac) checks your answer. Everything runs in your browser; nothing you type is sent anywhere.