Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Posts
    1

    Question Unanswered: Two semi-noobish questions

    Hello,
    this is my first post, so let's start with a couple of sorta noobish questions.

    A fictive scenario:
    I'm developing a very simple and generic browser game. My game has a statistics page, where players can view their progress over time, in form of various graphs.

    My database has table 'player':
    (id, name, population, army_size, score, ...)
    and, table 'player_history':
    (player_id, date, population, army_size, score, ...)

    My idea is, that 'player' table stores players' current status, and the data in 'player_history' is used to generate the graphs. Each player's status is stored in 'player_history' daily. Now, my first question is, simply, is there any point in this? Is there a better way?

    My second, and more important, question goes; if I want to have graphs that show players' ranking progress (highest score, largest army, etc.), should I add fields like 'population_rank', 'army_size_rank', 'score_rank' to 'player_history' table? Or should I use some really fancy join queries when generating the ranking graphs? I know it's possible without those _rank fields, I just don't know how to do it, or which way is smarter...

    I apologize if my questions are hard to understand. They were pretty hard to describe especially with English not being my native language...

    Thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    your english is excellent

    we cannot recommend a better way than what you've described, because we don't really know what your requirements are
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •