SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Month-over-Month Revenue Growth

Unsolved

Stripe's finance team tracks processed volume month over month. Only payments with `payment_status = 'succeeded'` count as revenue. Write an SQL query that returns one row per calendar month that has successful payments, with columns: `revenue_month` (formatted as `YYYY-MM`), `revenue` (sum of successful `amount`), `prev_revenue` (the previous month's revenue, NULL for the first month) and `growth_pct` (percentage change from the previous month, rounded to 2 decimal places, NULL for the first month). Order the results by `revenue_month` 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:
🏢 Stripe🏢 PayPal🏢 Square

Submission History

Your recent query executions and answer checks

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