Database · Medium
Find customers who bought one product but never bought another.
DatabaseSQL QueriesSeniorSubqueries
Answer preview
This is a semi-join plus an anti-join: match customers who have a line for product X, then exclude anyone who has any line for product Y with NOT EXISTS.…