Magnitude 5 and up
BeginnerWHEREEarthquakes (USGS, Oct 2026)
How many events have a magnitude (mag) of 5.0 or higher?
Solution
SELECT COUNT(*) FROM quakes WHERE mag >= 5;Expected output:
Hint
Filter with WHERE, then count.
Same question in Excel / Google Sheets
=COUNTIF(F:F,">=5") where column F holds mag.
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.