Created
March 3, 2017 22:23
-
-
Save tswast/3274b895388ea22c602de74f372891a3 to your computer and use it in GitHub Desktop.
Count the number of people with each name in the [USA Names public dataset](https://cloud.google.com/bigquery/public-data/usa-names).
This file contains 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
#standardSQL | |
SELECT | |
name, | |
name_total, | |
SUM(name_total) OVER(ORDER BY name ASC) AS name_cumulative | |
FROM ( | |
SELECT | |
name, | |
SUM(number) AS name_total | |
FROM | |
`bigquery-public-data.usa_names.usa_1910_2013` | |
GROUP BY | |
name ) | |
ORDER BY | |
name ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment