Loading…
Rank products by total revenue within each category.
| Step | What to do |
|---|---|
| CTE | Join products → orderItems, SUM revenue, GROUP BY product |
| Main query | Apply DENSE_RANK() OVER(PARTITION BY category ORDER BY total_revenue DESC) |
Downloading SQL engine… (one-time)
This runs entirely in your browser and is cached for next time.