Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2011
    Posts
    2

    Unanswered: Basketball Tournament.

    Note: I am a beginner with databases and i really need your help people. Thank you in advance.

    Reason why i am creating a database is to complete my project on VB.

    This project will be used by students which are the players in the player table and admin which is in staff table. Hence the username and password is added in attributes, for them to log in into the tournament.



    The issue i am facing today is: lack of attributes, dont know how to set E-R diagrams(main problem) nor foreign keys. And if you spot any other errors (e.g. in the tables or what so ever), please please tell.

    Tables and their attributes:

    Player Table (player ID, first name, surname,DOB, position, contact number,e-mail, username, password)

    Staff Table (staff ID , first name, surname, contact number,e-mail, username, password)

    Team Table (team ID, team name)

    Game Table (game ID, game date)

    Game Statistics Table (game statistics ID, points scored, field points, three points, free throws, personal fouls, blocks, steals, turovers, rebounds, minutes played)



    Sorry for my bad English language skills.

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    MY thinking would be

    what Player does the team play in so Playerid should be in the Team Table there that join

    what Games which teams playing so teamIDX2 should be in the game table there an other join
    also in the game table I would put the ScoresX2
    so you now who vs who and there Scores

    what Statistic Playerid in the Statistics table and and the other join

    so with a bit of joining You be able to look at the Stats and get the Team

    I would put the staffID in the Statistic then you now who did what

    a check could be sum of the Score in the Statistics table should = the Score in the Game table This would be a audit check only
    Last edited by myle; 04-19-11 at 09:11. Reason: spelling
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Aug 2009
    Location
    Up Nort' Wi
    Posts
    140
    Personally, given that the Player table and the Staff table are almost carbon copies of each other, I would combine the Player/Staff tables into one table "Person". Then make DOB a non required field.

    I would then utilize a lookup table called something like "PersonType" that would list your various options (Player, Coach, Referee, etc) for future expansion and to give you added report options. You would then take the Primary Key of the PersonType field and put that in your Person table as a Foreign Key.

    However, if it's possible a player can also be a coach/non player you will need to add what's called a junction table to allow them to have more than one status.

    Just my thoughts before my am coffee,

    Sam, HTH

    P.S. Please make sure you go though your tables and remove any spaces from the field names, spaces are evil and make coding 3 times harder/uglier than it needs to be.
    Good, fast, cheap...Pick 2.

  4. #4
    Join Date
    Apr 2011
    Posts
    2
    Thank you for your replies, i have been working with the database and ended up with this relationship, but not bonded...
    Imageshack - unledfss.jpg

    Any suggestions or what so ever please, do share.

    Oh and can somone please explain what would be the best relationship diagram... thanks.

Posting Permissions

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