Skip to main content
All Problems
medium0% acceptance

Each Product's Share of Total Revenue

Calculate each product's share of total revenue as a percentage. Return the product name, its revenue (quantity * unit_price), and its percentage of overall revenue (rounded to 2 decimal places). Sort by revenue_pct descending.

Schema

🔑idINT
nameTEXT
🔗category_idINT
priceREAL
costREAL
stock_quantityINT
created_atTIMESTAMP
postgresql

Run your query to see results

Press Ctrl + Enter to execute