Days Since the Previous Order (Store-Wide)

easy
Unit 7 · Window Functions II0/3 to milestone

Return each order's id, order_date and days_since_prev: days since the previous order in the whole store (by date, ties by id), or NULL for the first. Sort by order_date, then id.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions#dates1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Days Since the Previous Order (Store-Wide) · TechGradify