From the course: SQL Essential Training

Grouping your query results - SQL Tutorial

From the course: SQL Essential Training

Grouping your query results

- Here's the situation. We need to get a list of the average amount customers spend by billing Citi. Management at WSDA Music needs to know which cities have the best sales. This kind of information is useful when planning their marketing budget and knowing which cities to target their advertising dollars on. In this chapter, I'll introduce the Group By clause, which comes in handy for requests like this. The Group By clause is often used with aggregate functions like Count, Max, Min, and Average. For example, our current request by WSDA Music Management to list the average amount customers spend by billing Citi. Let's take a look at how we would use the Group By clause to answer this question.

Contents