Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Transaction Type Breakdown | CASE WHEN for Aggregates and Reporting
Practice
Projects
Quizzes & Challenges
Cuestionarios
Challenges
/
Mastering CASE WHEN in SQL

bookChallenge: Transaction Type Breakdown

Tarea

Swipe to start coding

Write a query that, for each month, shows the count of transactions of type 'purchase', 'refund', and 'fee' as separate columns.

  • For each month in the transactions table, count how many transactions have transaction_type equal to 'purchase'.
  • For each month, count how many transactions have transaction_type equal to 'refund'.
  • For each month, count how many transactions have transaction_type equal to 'fee'.
  • Show the results with one row per month, and columns for the month, purchase count, refund count, and fee count.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 5
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

close

bookChallenge: Transaction Type Breakdown

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write a query that, for each month, shows the count of transactions of type 'purchase', 'refund', and 'fee' as separate columns.

  • For each month in the transactions table, count how many transactions have transaction_type equal to 'purchase'.
  • For each month, count how many transactions have transaction_type equal to 'refund'.
  • For each month, count how many transactions have transaction_type equal to 'fee'.
  • Show the results with one row per month, and columns for the month, purchase count, refund count, and fee count.

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 4. Capítulo 5
single

single

some-alt