UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Table field / Relation advise    
 
   
chthomas
post Mar 18 2007, 05:25 AM
Post #1

UtterAccess Addict
Posts: 174
From: Abu Dhabi, U.A.E



I need to develop a database for sports day.

I created a ParticipantTable which has the following fields

Badge Number (Unique ID of the participant)
Name (Participant Name)
Team (Team to which the participant belongs)

I have a Table called Game which lists all the game names

A game can have 3 winners. Winner1 gets 3 points, Winner2 gets 2 points and Winner3 gets 1 point

What i would like to do is record against each game the winners and finally get the total Score per team(through a crosstab query ?). Am getting little lost on how to create a table for recording the game and winners. Should i need to create 3 different fields for 3 winners? Can someone please advise me on the table relationship. Am attaching the sample db.

Regards,


Charley
Attached File(s)
Attached File  Db1.zip ( 9.57K ) Number of downloads: 3
 
Go to the top of the page
 
+
ScottGem
post Mar 18 2007, 08:18 AM
Post #2

UtterAccess VIP / UA Clown
Posts: 25,212
From: LI, NY



tblParticipants
BadgeNumber (PK Autonumber?)
FirstName
LastName
TeamID (FK)

TblTeams
TeamID (PK Autonumber)
Team

tblGames
GameID (PK autonumber)
Game
Schedule

tblWinners
WinnerID (PK Autonumber)
GameID (FK)
BadgeNumber (FK)
PlaceID (First, Second, Third)

tluPlacePoints
PlaceID (PK)
Place

That should give you what you need to report points per team. I would manually set the PlaceID at 3 for First etc.to make totally the points easier.
Go to the top of the page
 
+
chthomas
post Mar 18 2007, 08:44 AM
Post #3

UtterAccess Addict
Posts: 174
From: Abu Dhabi, U.A.E



ScottGem,

Thanks. Excellent. Let me work around with this.

Regards,

Charley
Go to the top of the page
 
+
NoahP
post Mar 18 2007, 08:50 AM
Post #4

Retired Moderator
Posts: 10,493
From: Lexington/Louisville KY USA



To get maximum flexibility and to use the same database in the future, I'd add a table:

tblGamePlace
GamePlaceID Autonumber PK
GameID FK to tblGames
PlaceID FK to tblPlaces
PlacePoints Number

Not saying Scott's suggestion of getting double duty from a field is bad, but, if you want to use it again, I wouldn't do it that way. This way, if you have another game with say, 10 places, and places 5-7 get the same points, you could still handle it. Using PlaceID for the points as well wouldn't allow it.
Go to the top of the page
 
+
chthomas
post Mar 18 2007, 11:29 PM
Post #5

UtterAccess Addict
Posts: 174
From: Abu Dhabi, U.A.E



Thanks. Really an ammendment to Scott's solution.

Regards,

Charley
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 06:36 PM