MYSQL - SImple database design

Posted by sequelDesigner on Stack Overflow See other posts from Stack Overflow or by sequelDesigner
Published on 2011-01-11T12:42:36Z Indexed on 2011/01/11 12:53 UTC
Read the original article Hit count: 197

Filed under:
|

Hello guys,

I would like to develop a system, where user will get the data dynamically(what I mean dynamic is, without reloading pages, using AJAX.. but well, it does not matter much).

My situation is like this. I have this table, I called it "player", in this player table, I will store the player information like, player name, level, experience etc.

Each player can have different clothes, start from tops(shirts), bottoms, shoes, and hairstyle, and each player can have more than 1 tops, bottoms, shoes etc.

What I am hesitated or not very sure about is, how do you normally store the data? My current design is like this:

Player Table
===========================================================================================
id   |  name   | (others player's info)  |      wearing                   | tops | bottoms
===========================================================================================
  1  | player1 |                         | top=1;bottom=2;shoes=5;hair=8  | 1,2,3| 7,2,3


Tops Table
=====================
id  |  name   | etc...
=====================
 1  | t-shirt | ...

I am not sure if this design is good. If you are the database designer, how would you design the database? Or how you will store them?

Please advise. Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about database-design