Loading problem...
A retail analytics platform tracks customer purchases by SKU and wants to run a focused recommendation campaign for product C.
Table: customers
Table: orders
Goal: Find customers who are strong candidates for a product C recommendation. A customer is eligible if:
Output requirements:
Supported submission environments:
customers:
| customer_id | customer_name |
|-------------|---------------|
| 1 | Daniel |
| 2 | Diana |
| 3 | Elena |
| 4 | John |
orders:
| order_id | customer_id | product_name |
|----------|-------------|--------------|
| 10 | 1 | A |
| 20 | 1 | B |
| 30 | 1 | C |
| 40 | 2 | A |
| 50 | 3 | A |
| 60 | 3 | B |
| 70 | 3 | D |
| 80 | 4 | C |[
{"customer_id":3,"customer_name":"Elena"}
]Customer 3 has both A and B and never bought C. Customer 1 is disqualified because C appears, and customers 2 and 4 are missing one of A/B.
customers:
| customer_id | customer_name |
|-------------|---------------|
| 11 | Priya |
| 12 | Omar |
orders:
| order_id | customer_id | product_name |
|----------|-------------|--------------|
| 100 | 11 | A |
| 101 | 11 | C |
| 102 | 12 | B |[]No customer satisfies all eligibility rules at the same time.
customers:
| customer_id | customer_name |
|-------------|---------------|
| 21 | Mei |
| 22 | Carlos |
| 23 | Amina |
orders:
| order_id | customer_id | product_name |
|----------|-------------|--------------|
| 201 | 21 | A |
| 202 | 21 | B |
| 203 | 21 | B |
| 204 | 21 | E |
| 205 | 22 | A |
| 206 | 22 | B |
| 207 | 22 | C |
| 208 | 23 | A |
| 209 | 23 | B |
| 210 | 23 | F |[
{"customer_id":21,"customer_name":"Mei"},
{"customer_id":23,"customer_name":"Amina"}
]Duplicates and unrelated products do not matter for eligibility. Customer 22 is excluded because product C appears.
Constraints