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

single

Challenge: City-Based Sales Analysis

Stryg for at vise menuen

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 4
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

some-alt