Hard
Window Functions
Pro Challenge
Previous Order Comparison
Compare every order amount with the previous chronological order using LAG(), while preserving the complete order sequence. Return columns: id, order_date, total_amount, previous_amount. Order results by: order_date, id) AS previous_amount FROM orders ORDER BY order_date, id.
Preparing the interactive SQL workspace...