Find the top 3 best-selling products (by total quantity sold) in each category. Return category name, product name, total quantity sold, and the rank within the category. Use a CTE with a window function, then filter to rank <= 3.
Schema
🔑idINT
nameTEXT
descriptionTEXTNULL
postgresql
Run your query to see results
Press Ctrl + Enter to execute