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
 New to SQL Server Programming
 Need database design help

Author  Topic 

Apples
Posting Yak Master

146 Posts

Posted - 2010-08-21 : 18:22:52
I have a website for contests. There are groups, and the users are members of that group. Here's my database design so far:

--------------------
tblGroups
--------------------
ID | Name | Prize
--------------------


--------------------
tblMembers
--------------------
ID | Email | Name
--------------------


--------------------
tblGroupMembers
--------------------
GroupID | MemberID
--------------------


The contests occur every year. I'd like to be able to change the prize every year for a group, as well as have the users view the prizes from previous year for that group.

So if I'm in "Group A", I can see that in 2008 the prize was $50, and in 2009 the prize was $100. It is now 2010, so the user can activate the group for 2010 and set the prize for the new year.

An example of what I'm going for is a fantasy sports website, which keeps track of the group data over several seasons, showing past winners, records, stats, etc, and you can activate the group for a new season with all the same users.

How can I keep all the data for a group from previous years, and allow new data for the group every year? I assume I need a new table to keep track of that, but I don't know what to add and modify in my current schema.

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-08-22 : 07:17:30
what is the purpose of this fantasy sports website? and what do you want to hold in new table? can you give more vivid example?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-22 : 12:19:36
seems like what you need is a table having three columns GroupID,Year,PrizeAmt where you store prize amount for each group for each year.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Apples
Posting Yak Master

146 Posts

Posted - 2010-08-24 : 09:05:41
quote:
Originally posted by visakh16

seems like what you need is a table having three columns GroupID,Year,PrizeAmt where you store prize amount for each group for each year.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





I think that is what I need as well. Thank you.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-24 : 10:05:16
then whats the problem you're facing in it?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -