If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > normalising ER diagram

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-24-10, 11:40
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
normalising ER diagram

Can someone help me normalise my ER diagram please. Also it would be great if people can suggest improvements I can make to the current design.

Thanks in advance

Last edited by FullAdder; 11-24-10 at 14:40.
Reply With Quote
  #2 (permalink)  
Old 11-24-10, 13:25
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
player table and goal table can't both have an FK to each other

team table and group table can't both have an FK to each other

player table is missing an FK to team (can a player ever change teams?)

match table has two FKs to team but team doesn't have a matching column

match table has a goal_id? why?

match table has a group_id? why?

booking table has no PK

whew!!!
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-24-10, 13:44
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
As this is not specific to MySQL, its more to do with the overall db design this thread has been moved to the concepts

An earlier related thread may be found at:
Football league
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #4 (permalink)  
Old 11-24-10, 13:49
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
player table is missing an FK to team (can a player ever change teams?)

all players are signed to one team and they can't change over

match table has two FKs to team but team doesn't have a matching column

the two FK indicate that two teams are facing each other in a match

match table has a goal_id? why?
soon as a player scores a goal, a goal_id would be generated in the match table. but come to think of it now I don't need a GOAL_ID in the match table. the ID would be generated in the goal table soon as the player scores


I hope this answered your question, but let me known if you have an idea which is better than mine

Last edited by FullAdder; 11-24-10 at 14:00.
Reply With Quote
  #5 (permalink)  
Old 11-24-10, 13:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by FullAdder View Post
I hope this answered your question...
actually, i had several

and they were theoretical questions (pun intended)

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 11-24-10, 14:16
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
glicent said

Can you indicate which table require normalisation?
Reply With Quote
  #7 (permalink)  
Old 11-24-10, 14:24
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by FullAdder View Post
Can you indicate which table require normalisation?
only after you fix all the PK/FK issues

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #8 (permalink)  
Old 11-24-10, 14:48
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
match table has two FKs to team but team doesn't have a matching column

I don't understand the above question, can you give me more details?

Last edited by FullAdder; 11-24-10 at 16:36.
Reply With Quote
  #9 (permalink)  
Old 11-24-10, 14:55
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by FullAdder View Post
match table has two FKs to team but team doesn't have a matching column

I don't understand the above question, can you give me more details?
let me ask you... which column in the teams table do the fteam_id and steam_id columns reference?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #10 (permalink)  
Old 11-24-10, 14:59
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
I was think about have the fteam_id & steam_id as attribute. I hope that makes sense
Reply With Quote
  #11 (permalink)  
Old 11-24-10, 15:27
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
Quote:
Originally Posted by FullAdder View Post
I was think about have the fteam_id & steam_id as attribute. I hope that makes sense
What column in the team table properly completes this:

Code:
create table match (
    ...
    fteam_id int references team (???),
    steam_id int references team (???),
    ...
)
Also, you resolved your team-group FK opposite of what it should be.
Reply With Quote
  #12 (permalink)  
Old 11-24-10, 15:41
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
I am totally confused

I was thinking about manually adding the team in the match table.

I understand that FTEAM_ID & STEAM_ID has no reference in the team table

Last edited by FullAdder; 11-24-10 at 15:44.
Reply With Quote
  #13 (permalink)  
Old 11-24-10, 15:49
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
I think what you are trying to say is to resolve the issue I should label the FTEAM_ID & STEAM_ID as a FK

am I correct?
Reply With Quote
  #14 (permalink)  
Old 11-24-10, 16:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by FullAdder View Post
I think what you are trying to say is ...
no, if i was trying to say something, i would just say it

i was actually hoping you might try to answer the question i gave you --

which column in the teams table do the fteam_id and steam_id columns reference?

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #15 (permalink)  
Old 11-24-10, 16:36
FullAdder FullAdder is offline
Registered User
 
Join Date: Oct 2010
Posts: 37
they refer to the TEAM_NAME
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On