Let’s say that I’m developing an application to track boxing results. Is the best way to track these to have two tables, like so:
Boxers ====== id name Matches ======= id match_number boxer_id opponent_id result
… and then have two records for each match, one for the winner, and one for the loser, something like this:
id match_number boxer_id opponent_id result -- ------------ -------- ----------- ------ 1 1 1001 2001 WIN 2 1 2001 1001 LOSS
… or am I missing a better way to do this?
What if there wasn’t a result stored, just a recording that the two opponents were matched up?
Thanks!
Well, for a fully normalized, I’d go with:
Boxers – as cited.
Matches:
Opponents:
Two rows in Opponents and one in Matches for each match.
(Updated to add suggestions from other answers)