California, spelled two ways
IntermediateLIKE, inconsistent labelsEarthquakes (USGS, Oct 2026)
Some places end in , CA and some in , California. Count all events in California, catching both spellings.
Solution
SELECT COUNT(*)
FROM quakes
WHERE place LIKE '%, CA' OR place LIKE '%, California';Expected output:
Hint
Use two LIKE patterns joined with OR. The % wildcard matches anything before the comma.
Same question in Excel / Google Sheets
=COUNTIF(J:J,"*, CA")+COUNTIF(J:J,"*, California")
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.