Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Cumulative Sales by Region | Introduction to Window Functions
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Window Functions in SQL

bookChallenge: Cumulative Sales by Region

Завдання

Swipe to start coding

Write a query to calculate the cumulative sales amount for each region, ordered by sale_date.

  • Select the columns sale_id, sale_date, employee_id, region, and amount from the sales table.
  • Calculate a cumulative sum of the amount column for each region, ordered by sale_date and then by sale_id.
  • Name the cumulative sum column cumulative_sales.
  • Partition the calculation by region.
  • Order the final results by region, then by sale_date, and then by sale_id.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 7
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you explain this in simpler terms?

What are the main benefits or drawbacks?

Can you give me a real-world example?

close

bookChallenge: Cumulative Sales by Region

Свайпніть щоб показати меню

Завдання

Swipe to start coding

Write a query to calculate the cumulative sales amount for each region, ordered by sale_date.

  • Select the columns sale_id, sale_date, employee_id, region, and amount from the sales table.
  • Calculate a cumulative sum of the amount column for each region, ordered by sale_date and then by sale_id.
  • Name the cumulative sum column cumulative_sales.
  • Partition the calculation by region.
  • Order the final results by region, then by sale_date, and then by sale_id.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 7
single

single

some-alt