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.

Preparing the interactive SQL workspace...

Challenge overview

What you will practice

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.

Difficulty
Advanced
SQL concept
Window Functions