Revenue in a Customer's First 30 Days

medium
Unit 18 · Dates0/3 to milestone

For every customer (including those with no qualifying orders), return name and first_30d_revenue: the total of orders placed within 30 days of signup (order date at most signup_date + 30 days). Use 0 when none. Sort by first_30d_revenue descending, then name.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#dates#joins#aggregation1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Revenue in a Customer's First 30 Days · TechGradify