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.
Loading…
Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.
Ask questions, share alternate queries, and explore solutions
Your recent query executions and answer checks
This will insert the verified MySQL solution into your editor so you can study how each clause transforms the table.