Chapter 9 · Interview Level
17. Revenue Pivot by Payment Method Per Month
Medium20 XPE-Commerce
Create a monthly revenue breakdown by payment method. For each month (YYYY-MM format), show separate columns for credit_card, debit_card, paypal, and bank_transfer revenue. Sort chronologically.
Tables
- PKidINT
- FKorder_id→ orders.idINT
- payment_dateTEXT
- amountREAL
- methodTEXT
- statusTEXT
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.