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.



we store and display scores of users in different games. In MySQL, records are stored as tuples (us..

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

Post New Answer

More PHP Interview Questions

Explain what is meant by pear in php?

0 Answers  


Is php developer in demand?

0 Answers  


How many data types are there in php?

0 Answers  


What is the name of the scripting engine that powers PHP?

0 Answers  


What is the purpose of pear in php?

0 Answers  






How to make a class in php?

0 Answers  


Explain me differences between get and post methods?

0 Answers  


Is age interval or ordinal data?

0 Answers  


Explain how to submit form without a submit button.

0 Answers  


Why delimiter is used in mysql?

0 Answers  


Hi, My Name is Ajay Jha. What My Question is I am Percuing in Bca. It's My 5th Semester. I Want To Make My Carrear as a web designer that's Why i wants to do Php, Is it right Desision for Me ?

1 Answers  


What are the rules for naming a php variable?

0 Answers  


Categories