Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: City-Based Sales Analysis | Joining Tables for Richer Analysis
SQL for Data Analysis
Section 3. Chapter 4
single

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:

  1. Join sales and customers on the customer_id column.
  2. Group the result by city.
  3. For each city, count the number of sales using COUNT() and name the column sales_count.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt