I'm doing an inventory for a game, rather like a FF-style game. I have two design in mind, and wonder which is better
Keep track of quantity as a field; the schema would be:
item ( <item_id>, <character_id>, quantity )
. If a character equip an item, or remove an item from his inventory, I would need to make sure the quantity field is correct.Each item takes up a separate row. I will use GROUP BY to calculate the quantity of each type of item (by item_id). Equipping and removing items become more straightforward, though if the character has ten healing potions they would take up ten rows.
There are current no space constraint or limit on the programming (using MySQL). Which is the better system for the long run?