SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Monthly Approvals by Country

Unsolved

A payments team reports transaction volume by month and country. state is either 'approved' or 'declined'. For each month (formatted 'YYYY-MM') and country that has at least one transaction, report the number of transactions, the number of approved transactions, the total amount and the approved amount. A month and country with no approved transactions shows 0 for both approved columns. Write an SQL query that returns month, country, trans_count, approved_count, trans_total_amount and approved_total_amount. Order the results by month, then country.

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:
Classic pattern · not tied to a specific company

Submission History

Your recent query executions and answer checks

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