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
 Advice on the design

Author  Topic 

marric01
Starting Member

2 Posts

Posted - 2013-07-29 : 10:23:18
Hi,

I need an advice on how to model this scenario.

I have created a set table for hockey league manager.

Schedule (ScheduleID,Date,Time,DivisionFK, etc..)
ScoreKeeper (ScoreKeeperID, name,email,phone)
Referee (RefereeID,name, email, phone, comments,active)

In a specific game, theres always only 1 scorekeeper and theres always 1 to N referees.

How should I model this ? Can I put the ScoreKeeperID in the Schedule table as a FK ?

Thanks for any advice

marric

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-07-29 : 10:48:09
I would do this slightly differently. I would have the following tables:

1. Schedule
2. Persons (this will store info on human beings regardless of their role - scorekeeper, referee etc.)
3. Referees (this would have at least two columns - ScheduleId and PersonId. May have other columns to indicate other info, for example, roles like line judge or umpire).
4. ScoreKeepers (this is a judgement call. You could include the scorekeeper column in Schedule table, but in case your requirements expand to have multiple scorekeepers, perhaps a backup scorekeeper in the event that the main guy or gal came down with a severe case of flu etc.)

Depending on your requirements you might have other tables - for example, another table might be a table with Roles - ScoreKeeper, Referee, Player, Benchwarmers etc. Yet another table might be a link table between People and Roles, i.e., something which lists what each person is qualified for. Someone may be a scorekeeper most of the time, but they may be qualified to serve as a referee in a pinch.

Just some thoughts. Feel free to revise/shoot it down/comment as you see fit.
Go to Top of Page

marric01
Starting Member

2 Posts

Posted - 2013-07-29 : 13:14:45
Hi James

Thank you for the precious advices.

I think that i'm gonna go with the Persons table with roles. It's gonna be easier for future modifications to the system.

Thanks again for the fast reply !

Have a great day

marric
Go to Top of Page
   

- Advertisement -