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 |
Where php language is used?
Is php a backend?
How can we take a backup of a mysql table and how can we restore it. ?
7 Answers Brain Infosys, Oracle,
How many ways we can pass the variable through the navigation between the pages?
In how many ways we can retrieve the date in the result set of mysql using PHP?
What are new features in php 7?
What is php mean?
What is a role of a designer in web development. Till what level the designer will do his work. Does he gives the complete html file or the tpl file or he should also include the smarty tag in the tpl file.
Explain different types of errors in PHP (i.e. arguments in errorreporting function)?
8 Answers Base2 Infotech, DCI, Microsoft, Tata Elxsi,
Is it easy to learn php?
Do you know what is the difference between the include() and require() functions?
How we load all classes that placed in different directory in one php file , means how to do auto load classes.