Need advice implementing this database
Need advice implementing this database
(OP)
I'm supposed to be setting up a database for a local soccer league, I've been given this ERD http://i.imgur.com/4q5kL.png and have to implement it in Access.
Now I have create the tables with the fields listed in the ERD, made my Primary Keys and also added foreign keys to Match table (RefereeID) and Player table (TeamID) and created relationships for these http://i.imgur.com/jxLaQ.png
I am not sure how to create the relationship between Team and Match. If I create one foreign key in Match (TeamID) then the details of each match would have to be entered twice, which I can't have.
What can I do?
Thanks
Now I have create the tables with the fields listed in the ERD, made my Primary Keys and also added foreign keys to Match table (RefereeID) and Player table (TeamID) and created relationships for these http://i.imgur.com/jxLaQ.png
I am not sure how to create the relationship between Team and Match. If I create one foreign key in Match (TeamID) then the details of each match would have to be entered twice, which I can't have.
What can I do?
Thanks
RE: Need advice implementing this database
awayTeamID_fk (foreign key to away team)
RE: Need advice implementing this database
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?
RE: Need advice implementing this database
PHV: While it is a many-to-many relationship, I don't know if a junction table would work? I do find them a little confusing though so you might be on the money with that one?
RE: Need advice implementing this database
Would this be better than the team1/team2 solution?
RE: Need advice implementing this database
jncTblMatch_Team
matchID_fk
teamID_fk
teamType(home or away)
Building a user interface for that is more complicated.
so if team A and B are in match 1
1 A Away
1 B Home
A purist may say that is more normal, but not worth the burden in my opinion.
If you did it with three keys that is identical to my solution and gives you no difference.
RE: Need advice implementing this database
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?
RE: Need advice implementing this database
http://i.imgur.com/6FW98.png
Access made that Team_1 table by itself, although it does not appear in my list of tables. It is just another instance of the Team table?
Or should it be looking like this http://i.imgur.com/R1f9v.png ?
RE: Need advice implementing this database