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

bookChallenge: Segment Sales Data

Uppgift

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 allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 4
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me a real-world example?

close

bookChallenge: Segment Sales Data

Svep för att visa menyn

Uppgift

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 desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 4
single

single

some-alt