The second purchase is a key moment: it turns a one-off buyer into a customer. For every customer, return name, second_order (the date of their second order, or NULL) and days_to_second (whole days from their first order to their second, or NULL). Order a customer's orders by order_date, then id. Sort by name.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial