Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Cumulative Sales by Region | Introduction to Window Functions
Window Functions in SQL

bookChallenge: Cumulative Sales by Region

Tarefa

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.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 7
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

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

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 7
single

single

some-alt