Aggregating Data with GROUPÂ BY
In addition to just seeing individual rows of data, it is also interesting to understand the statistical properties of an entire column or table. For example, say you just received the sample dataset of ZoomZoom, which specializes in car and electronic scooter retailing. You are wondering about the number of customers that this ZoomZoom database contains. You could select all the data from the table and then see how many rows were pulled back, but it would require pulling the entire dataset and processing it manually, which is incredibly painful. Luckily, there are functionalities provided by SQL that can be used to perform this type of calculation on large groups of rows. These functionalities are called aggregations.
In this chapter, you will learn about the functions involved in aggregation operations and apply different levels of aggregation with the GROUP BY clause. You will learn how to enhance GROUP BY with filter conditions using the...