Practice · medium · dataset: ecom
First order per customer
For each customer who has ordered, find the date of their first order. Return customer_id,
email, and first_order_date.
Sort by first_order_date ascending, then by customer_id ascending.
Tables available
| Table | Columns |
|---|---|
customers |
customer_id, email, country, signup_date |
orders |
order_id, customer_id, order_date, status, channel |
Customers with no orders should not appear. A customer with several orders must appear once.
⌘/Ctrl + Enter to grade
Write a query, then grade it.
Hints
Try it first. Reveal a hint only when you are stuck.