SQL code copied to buffer
RU PT FR
Task 31:

Frequently Purchased Product Pairs

Write a query to find pairs of products that are frequently purchased together in the same SalesOrder. Retrieve pairs that have been sold more than 5 times. 
Output the results with columns ProductName1, ProductName2, and PairsCount, ordered by PairsCount in descending order, and then by ProductName1 and ProductName2 in ascending order.

Use SQL Server 2022 syntax to write your answer. Descriptions of tables are provided in the right pane.

Write your request in the field below and click the "Check it!" button.
Get hint
Copy code Clear editor

Hi! Could we please enable some services and cookies to improve your experience and our website?

Privacy & Cookie Policy.