Rank the App Leaderboard
Problem
An app store keeps a leaderboard of mobile games. For each game it stores how many five-star, four-star, and three-star reviews it has received.
Write a query that orders the leaderboard so that games with more five-star reviews rank first. Break ties using four-star reviews (more first), then three-star reviews (more first), and finally by the game title in alphabetical (ascending) order.
Return all columns: `title`, `five_star`, `four_star`, and `three_star`.
Tables
Example rows — the live problem includes the full dataset.
| title | five_star | four_star | three_star |
|---|---|---|---|
| Skyforge | 10 | 10 | 20 |
| Tidepool | 0 | 0 | 1 |
| Aether Run | 10 | 10 | 20 |
Expected output
Your answer should return 5 rows with the columns title, five_star, four_star, three_star.
Starter code (SQL)
SELECT *
FROM Leaderboard;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock