Customers Who Came Back the Next Month
HardDescription
A customer's first month is the month of their first order. Group the customers by their first month and show:
first_month: the first day of that month, as aDATEnew_customers: how many customers had their first order that monthcame_back: how many of them placed an order in the next calendar month (for a first month of January, that's February)pct_came_back:came_backas a percentage ofnew_customers, rounded to 1 decimal place
End your query with ORDER BY first_month.
Tables
| orders |
|---|
| order_id (PK) |
| customer_id (FK) |
| order_date |
| status |
| total_amount |
| shipping_city |