Compute the month-over-month growth rate of total transaction amounts. CTE: aggregate total amount per month. Main query: use LAG to get the previous month's total, then compute growth_rate as (current - previous) / previous * 100, rounded to 1 decimal. Sort by month.
Schema
🔑idINT
🔗account_idINT
transaction_dateTEXT
typeTEXT
amountREAL
balance_afterREAL
descriptionTEXT
reference_numberTEXT
postgresql
Run your query to see results
Press Ctrl + Enter to execute