Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
INTERVAL. An INTERVAL is a length of time, such as INTERVAL 30 DAY or INTERVAL 3 MONTH. Adding or subtracting one moves a date: DATE '2025-06-15' - INTERVAL 3 MONTH is 15 March. That makes rolling windows such as 'the last 90 days' easy to write against a fixed as-of date.
select customer_name, signup_date from customers where signup_date > DATE '2025-05-23' - INTERVAL 30 DAY
Sales wants a year-end pulse check: completed orders per channel in the 30 days up to 31 December 2025.
Return channel and orders: the number of completed orders whose order_date is after 2025-12-31 minus 30 days (that is, from 2025-12-02 to 2025-12-31), one row per channel.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe