Rank Games by Revenue
A video-game store is curating a "Best Sellers" shelf and wants its catalog ranked by revenue. For each game, compute total revenue (quantity * price across all order lines) and assign a rank — 1 to the top earner, 2 to the next, and so on. Output the title, revenue, and rank, sorted by rank.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| rank | title | total_revenue |
|---|---|---|
| 1 | Neon Drift | 209.93 |
| 2 | Stellar Conquest | 99.98 |
| 3 | Mystery Manor | 74.97 |
Sberbank
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in