Hey Tom, many thanks for the help.

At times I will need to identify whether a match is a "tournament match" 
or not.  It seems from what you're suggesting that I should do a select 
on the tournamentMembershipTable (with zero results being "no") rather 
than having a tournamentMatch boolean in the matchTable.

This seems mildly counter-intuitive to me but I'm trying to learn DB design!

Ian


>> 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?
> No, at least ideally not, since a large number of the values will be null, 
> which is not a proper normalised design.
>
>> Or should I create a new "tournamentMembershipTable" which holds a simple 
>> relationship between matchid and tournament id?
> Yes.
>
> Something like:
>
> create table tournamentMembershipTable
> (     matchID integer primary key not null references matchTable (id) on 
> delete cascade
> ,     tournamentID integer not null references tournament (id) on delete 
> cascade
> )
>

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

Reply via email to