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

bookChallenge: Transaction Type Breakdown

Tâche

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.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 5
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Transaction Type Breakdown

Glissez pour afficher le menu

Tâche

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.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 5
single

single

some-alt