Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Aggregate Monthly Sales | Time-Series Aggregation
SQL for Finance and Accounting

bookChallenge: Aggregate Monthly Sales

Task

Swipe to start coding

Write a SQL query to calculate the total sales amount for each month using the transactions table. The query should group results by month and only include transactions where the category is 'Sales'.

  • Use the transactions table.
  • Group the results by month using the transaction_date column.
  • Only include rows where category is 'Sales'.
  • Calculate the total sales amount for each month.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Aggregate Monthly Sales

Swipe to show menu

Task

Swipe to start coding

Write a SQL query to calculate the total sales amount for each month using the transactions table. The query should group results by month and only include transactions where the category is 'Sales'.

  • Use the transactions table.
  • Group the results by month using the transaction_date column.
  • Only include rows where category is 'Sales'.
  • Calculate the total sales amount for each month.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2
single

single

some-alt