Customers Who Bought Both Pen and Book
Medium
Relational Division
Return the customer_ids that have bought both 'Pen' and 'Book'. Order by customer_id.
Table schema
Orders(customer_id INT, product VARCHAR(20))Sample data
customer_id | product
1 | Pen
1 | Book
2 | Pen
3 | Book
3 | Pen
3 | Bag
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.