Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Segment Sales Data | Aggregations for KPIs
SQL for Business Intelligence Analysts

bookChallenge: Segment Sales Data

Opgave

Swipe to start coding

Write two SQL queries using the existing sales table to analyze sales performance by product and by customer.

  • The first query must return each product_id along with the total sales amount for that product. Use SUM(total_amount) and group by product_id.
  • The second query must return each customer_id along with the number of orders placed by that customer. Use COUNT(sale_id) and group by customer_id.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. 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

close

bookChallenge: Segment Sales Data

Stryg for at vise menuen

Opgave

Swipe to start coding

Write two SQL queries using the existing sales table to analyze sales performance by product and by customer.

  • The first query must return each product_id along with the total sales amount for that product. Use SUM(total_amount) and group by product_id.
  • The second query must return each customer_id along with the number of orders placed by that customer. Use COUNT(sale_id) and group by customer_id.

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 1. Kapitel 4
single

single

some-alt