Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2006
    Location
    Malvern, PA
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Ideas for Table Structure

    I have a DB that is used to register teams for a soccer league. The primary purpose/function is managing team contact info and payment histories.

    Right now the DB contains the following tables:

    Contacts
    -contactID
    -email
    -fname
    -lname
    -phone
    -address
    -date

    Teams
    -teamID
    -tname
    -contactID
    -club
    -age

    Registration
    -regID
    -teamID
    -league
    -session
    -reqdiv
    -date
    -misc

    Payments
    -payID
    -regID
    -payer
    -note
    -date
    -type

    I would like to add a scheduling component to this system and am trying to figure out the best way to do this. How would people store this schedule? Do you suggest a "Schedule" table with each record being a game? OR a schedule table with an individual record for each team and unique fields contain the game assignment. (There's 8 games per season.)

    I have search for examples but can't find anything that fits. Mostly just turned up calendar apps or resource scheduling. That are only scheduling one entity (person/equiment) not two entities (teams).

    Thanks for any thoughts. . .

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    A schedule table would work fine in this instance, each row can be one individual game.
    OracleGuy

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,664
    Thanks
    80
    Thanked 4,643 Times in 4,605 Posts
    You could even combine your schedule with your results, all in one table.

    Maybe something like:

    homeTeamID : fk to Teams table
    awayTeamID : fk to Teams table
    when : DateTime
    homeTeamScore : int, default NULL (indicates no results in this game yet)
    awayTeamScore : int, default NULL

    Then it's reasonably easy to find the record for a given team or for all teams from just that data.

  • Users who have thanked Old Pedant for this post:

    dmilani (02-26-2009)


  •  

    Posting Permissions

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