Challenge¶
Using the austin_bikeshare
public dataset, calculate summary statistics on all the trips. Namely,
- total trips
- min_start_time
- max_start_time
- avg_duration_minutes
How do I access the austin_bikeshare
dataset?
Solution¶
Explanation
count(*)
counts the number of rows in the table.min(start_time) as min_start_time
aggregates thestart_time
field, measuring the minstart_time
and naming the resultmin_start_time
.max(start_time) as max_start_time
aggregates thestart_time
field, measuring the maxstart_time
and naming the resultmax_start_time
.avg(duration_minutes) as avg_duration_minutes
aggregates theduration_minutes
field, measuring the mean duration_minutes and naming the resultavg_duration_minutes
.FROM bigquery-public-data.austin_bikeshare.bikeshare_trips
references thebikeshare_trips
table in theaustin_bikeshare
dataset in thebigquery-public-data
project.