I am creating a MySQL database for quiz bowl. The design is to have a cross table containing all game results, the cross table having the form:
CREATE TABLE game_results(
id SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
game_id MEDIUMINT NOT NULL,
team_id SMALLINT NOT NULL,
score MEDIUMINT);
My question is how does one count the number of wins a team has (that is, the number of times a team is the highest scoring team in a particular game) from the table game_results using MySQL.
1 Answer