On Jun 29, 2011, at 10:35 AM, Ian Hardingham wrote:

> Hey guys.
> 
> I have an existing table, the matchTable, where each entry holds a lot 
> of information about a "match".
> 
> I am adding a tournament system, and each match will either be in a 
> tournament or not in a tournament.
> 
> Should I add a "tournamentID" column to matchTable?  Or should I create 
> a new "tournamentMembershipTable" which holds a simple relationship 
> between matchid and tournament id?




If each "match" will belong to only one "tournament" while each "tournament" 
may relate to more than one "match" then create a "tournatmentID" in the 
"match" table. If you leave that NULL or, say, 0, then that match will not be 
in any tournament, else will be in the tournament with that tournamentID.

On the other hand, if each match may relate to zero or more tournaments, and 
each tournament may relate to zero or more matches, then create a separate 
tournamentMembershipTable.


> 
> Thanks,
> Ian
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to