Skip to main content
All Problems
medium0% acceptance

Product Pairs in the Same Category

Find all pairs of products that belong to the same category. Return the category_id, the name of the first product (product_a), and the name of the second product (product_b). Avoid duplicate pairs by ensuring the first product's id is less than the second's.

Schema

🔑idINT
nameTEXT
🔗category_idINT
priceREAL
costREAL
stock_quantityINT
created_atTIMESTAMP
postgresql

Run your query to see results

Press Ctrl + Enter to execute