Practice · medium · dataset: ecom
Customers who bought product 17
Marketing wants the distinct customers who have bought product 17. Return customer_id and
email, sorted by customer_id ascending.
A customer with several orders containing the product must appear once.
Tables available
| Table | Columns |
|---|---|
customers |
customer_id, email, country, signup_date |
orders |
order_id, customer_id, order_date, status, channel |
order_items |
order_id, product_id, quantity, unit_price |
⌘/Ctrl + Enter to grade
Write a query, then grade it.
Hints
Try it first. Reveal a hint only when you are stuck.