#standardSQL
SELECT state, year, sum(number) as number
FROM `bigquery-public-data.usa_names.usa_1910_current`
group by state, year
order by number desc
#standardSQL
SELECT name, sum(number) as number
FROM `bigquery-public-data.usa_names.usa_1910_current`
group by name
order by number desc
#standardSQL
SELECT name, year, sum(number) as number
FROM `bigquery-public-data.usa_names.usa_1910_current`
where name = 'James'
group by name, year
order by number desc
#standardSQL
SELECT passenger_count, count(passenger_count) as number
FROM `nyc-tlc.green.trips_2014`
group by passenger_count
order by number desc
#standardSQL
SELECT passenger_count, count(passenger_count) as number
FROM `nyc-tlc.green.trips_*`
where _table_suffix between '2014' and '2015'
group by passenger_count
order by number desc
#standardSQL
SELECT EXTRACT(YEAR FROM pickup_datetime) as year, count(pickup_datetime) as total
FROM `nyc-tlc.green.trips_*`
where _table_suffix between '2014' and '2015'
group by year
order by total desc