Skip to main content
All Problems
medium0% acceptance

Rank Products by Price Within Category

The catalog team wants to rank products by price within each category. Return the category name, product name, price, and a rank (1 = most expensive). Use RANK() so ties share the same rank.

Schema

🔑idINT
nameTEXT
descriptionTEXTNULL
postgresql

Run your query to see results

Press Ctrl + Enter to execute