Hard
Window Functions
Pro Challenge
Month-over-Month Order Growth
Calculate total orders and revenue per month, and show the difference from the previous month using LAG(). Return columns: month, orders, revenue, prev_revenue, revenue_change. Order results by: month) AS prev_revenue, revenue - LAG(revenue) OVER (ORDER BY month) AS revenue_change FROM monthly ORDER BY month.
Preparing the interactive SQL workspace...