SQL interview question: Month-over-month revenue growth
hard
CTE
LAG
date functions
Return each month (YYYY-MM), its revenue, and the percentage change from the previous month rounded to 1 decimal. The first month has NULL growth. Order by month.
Expected columns: month, revenue, growth_pct. Column names don't have to match. Runs on SQLite in your browser.
Tables: customers + orders
Your query
Ctrl/Cmd + Enter