Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    2

    ERD of football database

    Hi there

    Im currently doing a project trying to research a soccer database and at the moment I am working on drawing up an ERD.

    I have only a little experience in database design and was wondering if anyone would be willing to look over the ERD and suggest improvements.

    I am having particular trouble in trying to represent the fact that a player could belong to two teams (one proper and one on loan), and also how the fixtures and results would be represented in terms of tables.

    I have attached the ERD for anyone who wishes to view it.

    If any more details are needed feel free to ask.

    thanks in advance
    Attached Thumbnails Attached Thumbnails footballdatabase.JPG  

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by starkytwo
    I am having particular trouble in trying to represent the fact that a player could belong to two teams (one proper and one on loan),
    there are two approaches

    1. add a "role" attribute to the Team_Player table

    pro: only one relationship table
    con: must allow multiple rows per player, tricky to limit this to 2

    2. leave Team_Player as proper, add separate Team_Player_Onloan relationship table

    pro: PKs can be enforced
    con: queries get trickier
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Wait a minute. Did you say Football, or did you say Soccer? Make up your mind.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Mar 2008
    Posts
    2
    hi

    thanks for your replys. I am talking about soccer, sorry I put football in the thread title but then realised that may mean american football to some of you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •