What is the best way to keep track of the scores between all the players from a database ? How many times a player won/lost against another.
I thought about a duel
table where I would have 3 colums: duel_id
, winner_id
and loser_id
but I believe there is a better way to do this, avoiding redundancies.
Edit: I'm very sorry for not being clear enough. The players are in fact picked randomly from a user
table. I need to know who won/lost against whom. And the reason why I don't really like my solution is because when doing statistics, the whole duel
table would have to be scanned in order to return the amount of wins/losses between two players.