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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the functionality of md5 function in php?

1016


What is a query give example?

986


How to get number of days between two given dates using PHP?

896


Does strlen include null?

1071


How can you create a session in php?

1060


Which function is used in php to delete a file?

1018


Explain how you can update memcached when you make changes to php?

1125


How to convert one date format into another in php?

905


What do you mean by having php as whitespace insensitive?

975


Differences between get and post methods?

1034


What is the use of die in php?

983


What are the different tables(engine) present in mysql, which one is default?

1026


Which function is used to read a file removing the html and php tags in it upwork?

926


Why die is used in php?

990


How to use http headers inside php?

1050