GROUP BY and Aggregate Functions

Perform grouped calculations with COUNT, SUM, AVG, MIN, MAX aggregate functions. ## Lesson objectives In this lesson, we will learn how to group data in SQL and how to calculate summary values for each group. In the previous lessons, we learned how to choose columns with , filter rows with , sort results with , and limit the number of rows with . But in real analysis, looking at individual rows is often not enough. We usually need summary results. For example: how many employees are in each department? how many employees are in each city? what is the average salary in each department? what is the total sales amount? what is the total sales amount for each product?