Calculate the month-over-month revenue growth rate. Use a CTE for monthly revenue, then use LAG to get the previous month's revenue. Compute growth as (current - previous) / previous * 100, rounded to 2 decimals. Sort by month.
Schema
🔑idINT
🔗customer_idINT
order_dateTEXT
statusTEXT
total_amountREAL
postgresql
Run your query to see results
Press Ctrl + Enter to execute