SQL for Data Analytics - Fourth Edition
by Jun Shan, Haibin Li, Matt Goldwasser, Upom Malik, Benjamin Johnston
8
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access