Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What is meant by pdo in php?

0 Answers  


What does the arrow mean in php?

0 Answers  


What is php and its features?

0 Answers  


Whether session will work if we disable cookies in client browser ?

10 Answers  


What is session in php why it is use?

0 Answers  


Which function is used to read a single character from a file in PHP.

0 Answers  


What is a closure in php?

0 Answers  


How does php server work?

0 Answers  


Write a program using while loop in php?

0 Answers  


What is sql injection in php?

0 Answers  


What is the difference between single quoted string and double quoted string?

0 Answers  


i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..

0 Answers   MNC,


Categories