Easy and Simple Solution
Please Like ❤️IntuitionWe need to find customers who have purchased all available products.Approach
Group by customer_id to aggregate purchases per customer.
Co
```mysql
# Write your MySQL query statement below
SELECT customer_id
FROM Customer
GROUP BY customer_id
HAVING COUNT(DISTINCT product_key) = (SELECT COUNT(product_key) FROM Product);
```

# Please Like ❤️  
![Please Like](https://media.tenor.com/heEyHbV8iaUAAAAM/puss-in-boots-shrek.gif)  

# Intuition  
We need to find customers who have purchased **all** available products.

# Approach  
1. **Group by `customer_id`** to aggregate purchases per customer.  
2. **Count distinct `product_key`** for each customer.  
3. **Compare this count** with the total number of products in the `Product` table using a subquery.  
4. **Return customers** where the counts match.

# Complexity  
- **Time Complexity:** $$O(n)$$ – We scan `Customer` and `Product` tables once.  
- **Space Complexity:** $$O(1)$$ – No extra storage used.
['MySQL']