Thread: Database Design

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    1
    Rep Power
    0

    Question Database Design


    Hello!
    Im designing a soccer betting site for fun and learning purposes.

    Say i have 1000 users in table db_users

    id, username

    and i have 10 open games to bet on. i have this table structure

    matchid, team1, totalbetonteam1, team2, totalbetonteam2

    i want to store what user bets on what team and how much. i dont really now performance wise how to handle that. ill figured ill mal a table

    usernaname, machid, team, amountuserbetonteam
    example
    bob, 12, 1, 3$

    but what if i have 1000 users all betting in each matchup on each team a little bit.
    i have 1000 (users) x 10 (open games) x 2 (teamcount) = 20000

    this gets worse with every matchup/user/team

    ideas?
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    20 thousand rows is fairly small

    call us when you get to 20 million

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo