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

bookChallenge: Quarterly Expense Report

Oppgave

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

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 6
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Quarterly Expense Report

Sveip for å vise menyen

Oppgave

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 desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 6
single

single

some-alt