Amazon's recommendation engine needs to know which products have a high affinity for one another. A bundle is defined as any two unique products purchased within the same order.
Write an SQL query to find the top 5 most frequent product pairs.
| order_id(INTEGER) | product_id(INTEGER) |
|---|---|
| 1 | 101 |
| 1 | 102 |
| 2 | 101 |
| 2 | 102 |
| 2 | 103 |
| 3 | 101 |
| 3 | 102 |
| 4 | 104 |
| 4 | 105 |
| product_a(INTEGER) | product_b(INTEGER) | bundle_count(INTEGER) |
|---|---|---|
| 101 | 102 | 3 |
| 101 | 103 | 1 |
| 102 | 103 | 1 |
| 104 | 105 | 1 |