Abschnitt 4. Kapitel 5
single
Challenge: Transaction Type Breakdown
Swipe um das Menü anzuzeigen
Aufgabe
Wischen, um mit dem Codieren zu beginnen
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
transactionstable, count how many transactions havetransaction_typeequal to 'purchase'. - For each month, count how many transactions have
transaction_typeequal to 'refund'. - For each month, count how many transactions have
transaction_typeequal to 'fee'. - Use
TO_CHAR(transaction_date, 'YYYY-MM')to extract the month from the date, and name this columnmonth. Show one row per month, with columnspurchase_count,refund_count, andfee_count.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 4. Kapitel 5
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen