we store and display scores of users in different games. In
MySQL, records are stored as tuples (user-id, game-id, score).
Now we need to support ranks of users, i.e., each user
should be informed of his current rank in the community. The
challenge is to come up with the best way to store the data
in MySQL so that the requirements are efficiently met.
Answer / amitverma
There's NO need to store the data in any "new" way because
the existing schema/tuple (user-id, game-id, score) is
enough for fetching and displaying the ranks of individual
users. Only need is to write few good SQL queries which
will do the job. We can display ranks as follows -
Select user-id, score from game_table where game-id='10'
order by score.
Note - The above SQL query will display the rankwise
listing of users (as per their scores) for a specific game,
which has id 10 (say cricket).
| Is This Answer Correct ? | 1 Yes | 1 No |
What is a helper function?
which is the best institute for php training near delhi & NCR......& what is the fee for the same....
How to check if a string contains a character or word in php?
Inside a php function, what param needs to be set in order to access a global variable?
What are the special characters you need to escape in single-quoted stings?
What is static variable in php?
Hi all,, im completely new to PHP, started learning just 2 days before. Can anybody tell me how to run a PHP file to see the program's output? i have created some simple program in Dreamweaver CS3 but don't know how to run it...
does current version of mysql (myisam) supports foreign keys ?
How many types of php frameworks are there?
how can i get USA time using php...
How do you call a constructor for a parent class?
How many escape sequences are recognized in double-quoted strings?