Which products generate the most revenue?
Grouping line items by product_id, summing amounts, and taking the top 10 finds revenue leaders.
Product catalog performance, inventory purchasing prioritization, sales leaderboards.
SELECT
product_id,
SUM(amount) AS revenue
FROM order_items
GROUP BY product_id
ORDER BY revenue DESC
LIMIT 10;Practice typing production-grade SQL code for Top Products.