SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Sales by Payment Type

Unsolved

Finance wants to compare payment methods. For each payment_type, report the total sales value and the number of distinct customers who paid with that type. A customer who used a payment type several times counts once for that type. Write an SQL query that returns payment_type, total_sales and unique_customers. Order the results by total_sales descending, then payment_type ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Meta

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM transactions
Full source dataset
10 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine