From the course: Data Science on Google Cloud Platform: Designing Data Warehouses

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Grouping and aggregations

Grouping and aggregations

From the course: Data Science on Google Cloud Platform: Designing Data Warehouses

Start my 1-month free trial

Grouping and aggregations

- [Instructor] Let's look at how to group and aggregate data with the query. BigQuery support query aggregation capabilities using group by, which can also be used to summarize and analyze data. In this example, we are going to generate some stats by gender of the patient. We will find the percentage of patients who smoke and drink and the average number of exercise days by gender. Let's focus on the query in the window. The query uses sum, count and average functions and then rounds up the data to display the results. Let's run the query, and before that, let's make sure that Legacy SQL is disabled. We see that the results show up by gender, which is exactly what we are trying to do here.

Contents