Chapter 4 · Aggregations
09. Payment Method Distribution
Easy10 XPE-Commerce
The payments team wants to see how payment methods are distributed. For each payment method, show the count of payments and the total amount collected where the payment status is 'completed'. Sort by total amount descending.
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.