Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Quarterly Expense Report | Time-Series Aggregation
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
SQL for Finance and Accounting

bookChallenge: Quarterly Expense Report

Uppgift

Swipe to start coding

Write a SQL query to calculate the total expenses for each quarter using the transactions table. Only include rows where the category is 'Expense'. Aggregate the amount by quarter, grouping the results by quarter.

  • Filter the rows in the transactions table to include only those where category is 'Expense'.
  • Group the filtered rows by quarter, using the transaction_date to determine the quarter and year.
  • Calculate the sum of the amount for each quarter.
  • Return the quarter (in the format YYYY-Qn) and the total expenses for that quarter.

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 6
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

close

bookChallenge: Quarterly Expense Report

Svep för att visa menyn

Uppgift

Swipe to start coding

Write a SQL query to calculate the total expenses for each quarter using the transactions table. Only include rows where the category is 'Expense'. Aggregate the amount by quarter, grouping the results by quarter.

  • Filter the rows in the transactions table to include only those where category is 'Expense'.
  • Group the filtered rows by quarter, using the transaction_date to determine the quarter and year.
  • Calculate the sum of the amount for each quarter.
  • Return the quarter (in the format YYYY-Qn) and the total expenses for that quarter.

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 6
single

single

some-alt