WITH monthly_sales AS (SELECT strftime('%Y-%m', order_date) AS month, SUM(amount) AS total_sales FROM orders GROUP BY month) SELECT month, total_sales, (total_sales - LAG(total_sales) OVER (ORDER BY month)) * 100.0 / LAG(total_sales) OVER (ORDER BY month) AS mom_growth FROM monthly_sales;
Write your query and click "Run Query" (Ctrl + Enter) to see results and testcase validation.