|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Table and/or Query Help
Hello, I am adding a section to my site to track high scores for different levels in a game. I am looking for the optimal table structure and optimal query to gather high scores for each level. I am planning to have two tables: one to keep track of meta data for each level and one for the actual scores.
boards table ----------------------------------------- boardID INT(11) PRIMARY KEY large_image VARCHAR(20) small_image VARCHAR(20) number_scores INT(11) scores table ------------------------------------------ entry INT(11) AUTONUMBER / PRMIARY KEY boardID INT(11) UNIQUE accountID INT(11) UNIQUE name VARCHAR(20) initials CHAR(3) score FLOAT To pull a list of all scores ranked in order, I plan to use the following query: SELECT boards.boardID, scores.name, scores.initials, scores.score FROM boards LEFT JOIN scores USING (boardID) ORDER BY boards.boardID, scores.score, scores.entry; The above query does work, but I am afraid what the performance will be like when each level (about 50) has several hundred entries. Is there a way I can run a single query and limit the number of results returned for each board? Or is it more efficient to run a query for each level and use the LIMIT clause? Thank you for your help |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Table and/or Query Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|