Database design for a Fantasy league

Posted by Samidh T on Stack Overflow See other posts from Stack Overflow or by Samidh T
Published on 2012-12-19T11:02:03Z Indexed on 2012/12/19 11:02 UTC
Read the original article Hit count: 221

Filed under:
|

Here's the basic schema for my database

Table user{
userid numeber primary key,
count number
}

Table player{
pid number primary key,
}

Table user-player{
userid number primary key foreign key(user),
pid number primary key foreign key(player)
}

Table temp{
pid number primary key,
points number
}

Here's what I intend to do...

  • After every match the temp table is updated which holds the id of players that played the last match and the points they earned.
  • Next run a procedure that will match the pid from temp table with every uid of user-player table having the same pid.
  • add the points from temp table to the count of user table for every matching uid.
  • empty temp table.

My questions is considering 200 players and 10000 users,Will this method be efficient? I am going to be using mysql for this.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about database-design