Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 should a circle like reference be avoided

Author  Topic 

kingjeremy
Starting Member

10 Posts

Posted - 2009-05-14 : 16:46:42
[players]
pId, pName

[scoreCategories]
scId, scName

[fields]
fId, fName

[tournaments]
tId, tName

[tournamentRounds]
trId, tId, trDate

[tournamentRoundFields]
trfId, trId, scId, fId


the rules are like this:
Each tournament can have one or more rounds, and each player joining a tournament plays in all rounds.
Players are divided in categories and each category will play in a different field.
If a player is in catA in first round he/she will always be in the same category troughout the tournament.
The fields can change for rounds.

My question is what would be the best choice for [tournamentPlayers] table
I came up with two options
1st
[tournamentPlayers]
tpId, tId, pId, scId

in this case you list a player for a tournament only once but when querying players for each round field you have to build a circle like relationship

[tournaments] --> [tournamentRounds] --> [tournamentRoundFields]
| |
----(tID)---[tournamentPlayers]-(scId)----

2nd
[tournamentPlayers]
tpId, pId, trfId
in this case you list a player repeatedly for every round but the relationship will be straightforward

[tournaments] --> [tournamentRounds] --> [tournamentRoundFields] --> [tournamentPlayers]

will there be a significant performance difference between the first and second choice as the tables build up with data or are these both just fine (or any other 3rd opiton?)

also note that 1st one is better on the form design part since you can seperately add players to a tournament and later decide which category/field they will play, in the 2nd choice you have to assign a category/field to add player to a tournament
   

- Advertisement -