Find Lapsed Customers

medium
Unit 18 · Dates0/3 to milestone

A customer has lapsed if their last order was more than 30 days before the most recent order date in the whole table (use that as "today" so the query works on historical data).

Return name, last_order (their latest order date) and days_since (whole days between that date and "today", as an integer) for each lapsed customer. Sort by days_since descending, then name.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#dates#having#churn1 visible + 2 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Find Lapsed Customers · TechGradify