Section 3. Chapter 4
single
Challenge: City-Based Sales Analysis
Swipe to show menu
Task
Swipe to start coding
You have two tables: sales and customers.
sales — records of each individual sale:
customers — information about customers:
Write a query that shows how many sales were made in each city. To do this:
- Join
salesandcustomerson thecustomer_idcolumn. - Group the result by
city. - For each city, count the number of sales using
COUNT()and name the columnsales_count.
Solution
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 4
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat