Skip to main content

Game Leaderboard

HardPremium

Zynga is a social game development company known for its popular games played by millions worldwide. Within their games, players can form teams and compete. Each player's performance in different game sessions is recorded as distinct score entries in the database.

You're provided two tables players and scores:

player_idplayer_nameteam_id
integerstringinteger
score_idplayer_idgame_score
integerintegerinteger

Write a SQL query to return the top 2 players from each team based on their single highest score across all sessions. If multiple players share the same highest score, include all of them, which may result in more than two top players for some teams.