๐ท๏ธ Some Customers Only Buy on Sale.
The pricing team at Meesho suspects a segment of customers who only ever purchase when a coupon is applied โ they never pay full price.
Find customers who have placed at least one order but ALL of their orders used a coupon (coupon_used = 1). Return customer_id and name.
orders Table:
| Column | Type |
|---|---|
| order_id | integer |
| customer_id | integer |
| amount | integer |
| coupon_used | integer (1 = yes, 0 = no) |
| order_date | text |
customers Table:
| Column | Type |
|---|---|
| customer_id | integer |
| name | text |
Expected Outcome (Illustrative Sample):
| customer_id | name |
|---|---|
| 1 | Sneha Rao |
Hint: every order for that customer must have coupon_used = 1. Use GROUP BY with HAVING.