Hard
INNER JOIN
Pro Challenge

Products Frequently Bought Together Without Double Counting

Find canonical product pairs appearing together in at least two distinct completed baskets. Repeated lines for a product in one basket count once. Return product_a, product_b and basket_count, ordered by basket_count descending then product IDs. Return columns: product_a, product_b, basket_count.

Preparing the interactive SQL workspace...

Challenge overview

What you will practice

Find canonical product pairs appearing together in at least two distinct completed baskets. Repeated lines for a product in one basket count once. Return product_a, product_b and basket_count, ordered by basket_count descending then product IDs. Return columns: product_a, product_b, basket_count.

Difficulty
Advanced
SQL concept
INNER JOIN