Rock-Paper-Scissors-Spock-Lizard statistics DB design, is there a better way to achieve this?
To increase efficiency, you could run the query and get all 3 results at once:

SELECT COUNT(*) AS cnt, result 
FROM match 
GROUP BY result


That should give you 3 rows in this situation, which you can deal with in the application layer however you want.

As by the example above, you would get something like the following:

Cnt | Result
10 | 0
15 | 1
25 | 2


I would personally say do the following with structure:



The Matches table holds one record per match, with references to each other table.

The Player table holds one record for each player (Whether they are a computer or user), with a reference to the PlayerType table

The PlayerTypes table holds the ID and the type of player (User, or computer etc)

The ResultTypes table holds a record for each possible result of a match, with the TypeName column being the text for that result (IE 'Won', 'Loss' etc)

I've not added any foreign keys etc - should be fairly easy to work out from the names though. http://sqlfiddle.com/#!9/865078

The below query would then give you your result:

SELECT COUNT(Matches.ID), ResultTypes.TypeName
FROM Matches
INNER JOIN ResultTypes ON Matches.ResultID = ResultTypes.TypeID
GROUP BY ResultTypes.TypeName