SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot gregs's Avatar
    Join Date
    Aug 2002
    Posts
    161
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Relational Database Advice?

    This may be the wrong forum to post this, but I will try.
    Would someone be willing to give me some advice on how to set this database/table up. I am sort of familiar with Relational Databases, but would like to see if someone has a better idea than I do of building a HUGE schedule table.

    This is very similiar to how I would like the output

    Code:
    2002
    Wynne Yellowjackets
    AAAA-East
    
    Overall       4 -  1 -  0
    Conference    2 -  0
    
    Date     Opponent
    
    09-06    Forrest City                 28 -   7
    09-13 at Jonesboro                     7 -  20
    09-20 at Newport                      27 -   3
    09-27 at Nettleton *                  41 -   0
    10-04    Greene Co Tech *             41 -   0
    10-11 at Beebe *
    10-18    Paragould *
    10-25 at Marion *
    11-01 at Vilonia *
    11-08    Batesville *
    Max TeamName Length = 25
    Question? Must each record have a WEEK field for
    proper Weekly Game sorting purposes?

    Code:
    << Example Template >>
    ----------------------------------------------------------------------
    $Date
    $TeamName $TeamMascot
    $Conference
    
    Overall       $OW -  $OL -  $OT
    Conference    $CW -  $CL
    
    Date     Opponent
    
    $g[1][date]  $g[1][played]  $g[1][opponent]  $g[1][home]  $g[1][guest]
    $g[2][date]  $g[2][played]  $g[2][opponent]  $g[2][home]  $g[2][guest]
    $g[3][date]  $g[3][played]  $g[3][opponent]  $g[3][home]  $g[3][guest]
    $g[4][date]  $g[4][played]  $g[4][opponent]  $g[4][home]  $g[4][guest]
    $g[5][date]  $g[5][played]  $g[5][opponent]  $g[5][home]  $g[5][guest]
    $g[6][date]  $g[6][played]  $g[6][opponent]  $g[6][home]  $g[6][guest]
    $g[7][date]  $g[7][played]  $g[7][opponent]  $g[7][home]  $g[7][guest]
    $g[8][date]  $g[8][played]  $g[8][opponent]  $g[8][home]  $g[8][guest]
    $g[9][date]  $g[9][played]  $g[9][opponent]  $g[9][home]  $g[9][guest]
    $g[10][date] $g[10][played] $g[10][opponent] $g[10][home] $g[10][guest]
    ----------------------------------------------------------------------
    How, in a relational database, would this information need to
    be stored so it is easy to associate and retrieve for the
    team needing the information printed out. What would be the most
    EFFICIENT way to store this for max usage on multiple pages?

    Would you put ALL the games played into one HUGE table?
    Example:
    Table: Football_Teams: $id, $TeamName, $TeamMascot, $Conference
    Football_Schedules?

  2. #2
    SitePoint Guru enygmadae's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Tx.
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    team_info table:
    team_name
    year_added
    conference
    team_id
    other team info....

    team_stats table:
    team_id
    versus_id
    date_played
    team_id_score
    versus_id_score 
    then you can just do joins and count()s on the tables to get your stats....
    PHP News, Views and Community: http://www.phpdeveloper.org

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to a more appropriate forum

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


Bookmarks

Posting Permissions

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