Go Back   Access World Forums > Microsoft Access Discussion > Tables

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-27-2003, 05:22 AM   #1
MrBLT
Junior Member
 
Join Date: Oct 2003
Location: Australia
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
MrBLT
First DB issue

I'm trying to make a basketball database and i was going to enter each team in seperately. However whenever i enter a new team in say my score table, there is an error saying that it would create duplicate errors in the index, primary key or relationship. Why is this happening, or how can i get around this problem
Thanks

MrBLT is offline   Reply With Quote
Old 11-27-2003, 05:30 AM   #2
Rich
Guest
 
Posts: n/a
Some details of your table structure would be helpful
  Reply With Quote
Old 11-27-2003, 05:37 AM   #3
MrBLT
Junior Member
 
Join Date: Oct 2003
Location: Australia
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
MrBLT
sorry about that
my table structure are as follows

gameid
date
home
away
venueid
homeATS
awayATS

gameid
1stqtr
2ndqtr
3rdqtr
4thqtr

gameid
teamid
fgm
fga
3ptm
3pta
ftm
fta
reb
foul
assist
block
steal
turnover

teamid
team

venueid
venue

this is my first database. it may be that my tables aren't right, i'm not sure.
Thanks. hope this is helpful

MrBLT is offline   Reply With Quote
Old 11-27-2003, 05:56 AM   #4
MrBLT
Junior Member
 
Join Date: Oct 2003
Location: Australia
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
MrBLT
so basically i have the game info in the 1st table

gameid
date
home
away
venueid
homeATS
awayATS

i home team scores in the 2nd table

gameid
1stqtr
2ndqtr
3rdqtr
4thqtr

when i try to enter the away team scores in the same table using the same gameid, it tell me that there is an error saying that it would create duplicate errors in the index, primary key or relationship.
MrBLT is offline   Reply With Quote
Old 11-27-2003, 06:44 PM   #5
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,133
Thanks: 15
Thanked 1,570 Times in 1,492 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
The scores table needs a two-field primary key.

gameid (pk, field1)
teamid (pk, field2)
1stqtr
2ndqtr
3rdqtr
4thqtr

I would change this table further to normalize it which will make it more flexible.

gameid (pk, field1)
teamid (pk, field2)
periodid (pk, field3)
Score

With this structure, the table can hold scores for any number of periods. For example, 4 periods plus 1 or more others for overtime for basketball or football. Three periods plus a fourth for overtime for hockey. Nine innings, plus any additional innings for baseball. I would also normalize your play table in a similar way. You could even keep the play stats by period if you want that level of detail.

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 08:47 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World