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.
Schema
🔑idINT
🔗order_idINT
payment_dateTEXT
amountREAL
methodTEXT
statusTEXT
postgresql
Run your query to see results
Press Ctrl + Enter to execute