Task on negative logic. **Condition:** Find all pairs of products from the catalog that have never been in the same order. **Table:** order_items (order_id, product_id, ...) **Requirements:** 1. Generate all possible pairs of products (A, B where A < B) 2. Find pairs that have been in the same order at least once 3. Return pairs that are not among those purchased together **Hint:** CROSS JOIN for all pairs + NOT EXISTS for checking.
Sign in to solve
Start Solving