Five most populous states (2024)
Beginnerfilter + sortState population estimates (U.S. Census Bureau, Vintage 2024)
Return name and pop2024 for the 5 most populous state-level rows, largest first.
Solution
SELECT name, pop2024
FROM state_population
WHERE sumlev = '040'
ORDER BY pop2024 DESC
LIMIT 5;Expected output:
Hint
Filter to sumlev = '040' first, or the United States row will win.
Same question in Excel / Google Sheets
Filter sumlev = 040, sort pop2024 Z→A.
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.