Created
August 26, 2021 16:19
-
-
Save rruntsch/e4856e6e01aaac3ed26a8cca03ef9930 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- get_us_city_population.sql | |
-- Clean city names and state codes. | |
SELECT | |
CASE | |
WHEN City = 'Aims' THEN 'Ames' | |
WHEN City = 'Amerillo' THEN 'Amarillo' | |
WHEN City = 'Austen' THEN 'Austin' | |
WHEN City = 'Boyse' THEN 'Boise' | |
WHEN City = 'Charlestown' THEN 'Charleston' | |
WHEN City = 'Checago' THEN 'Chicago' | |
WHEN City = 'DesMoines' THEN 'Des Moines' | |
WHEN City = 'Honnollullu' THEN 'Honolulu' | |
WHEN City = 'Rchester' THEN 'Rochester' | |
WHEN City = 'San Fransisco' THEN 'San Francisco' | |
ELSE City | |
END AS City | |
, CASE | |
WHEN State_Code = 'MP' AND City = 'Minneapolis' THEN 'MN' | |
ELSE State_Code | |
END AS State_Code | |
, [Population] | |
FROM City_Population | |
ORDER BY | |
State_Code | |
, City; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment