From the course: Data Analytics with Google Cloud BigQuery and Looker Studio

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Aggregation functions in BigQuery

Aggregation functions in BigQuery

- [Instructor] In our last video, we got started with BigQuery query editor, and we run a simple query against the GSOD dataset. But to answer the question we had at the beginning, "How did the global temperature change in the past years?", we probably want to know the average temperature of each year in the past. For this, we need to do some aggregation. Aggregation is basically things like getting the sum across multiple rows, getting the maximum value, or getting the average value. There are a number of aggregate functions supported by BigQuery. In our case, we will make use of the AVG function, which means average. Let's go back to the BigQuery query editor. This is a query we wrote in the last video. If we run this query, the results are the individual temperature records that we have in this table. How do we get the average? If you worked with SQL before, you will know we simply just need to apply the AVG function…

Contents