Look at neighbouring rows: LAG, LEAD and DENSE_RANK · exercise 1 of 1 · free preview
LAG(column) OVER (ORDER BY ...) returns the value from the previous row, in the order you give. The first row has no previous row, so it gets NULL. It is like pointing a formula at the cell above.
For every order, show order_id, order_date and prev_date: the order_date of the previous order when sorted by order_id. Order by order_id.
Tables in this practice shop
customersproductsordersorder_items