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

bookChallenge: Quarterly Expense Report

Tarea

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.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 6
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

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: Quarterly Expense Report

Desliza para mostrar el menú

Tarea

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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 6
single

single

some-alt