Creating a database for a basic game

Started by Mobo01, January 04, 2023, 11:05:22 PM

Previous topic - Next topic


I'm creating a database for a basic web game.

To isolate my issue, assume there are two tables that reference each other as seen below.
Player ( p_id, p_name, inventory(multiple i_id) )
Item ( i_id, i_name )

The issue is with the inventory column, which is used to store numerous ids from the Item database. First and foremost, I'm not sure if holding several id values in a single column is a smart design approach. Alternately, split into three tables as follows:
Player ( p_id, p_name )
Item ( i_id, i_name )
Inventory ( i_id )

Now that Inventory is no longer a column, it may have numerous ids, but how do I associate this collection of inventory data with a certain player? This">website that if I want to have numerous 'daggers' in my inventory, I need to add a field to the inventory table. Is that right?

Each player, as in other RPG games, has their own inventory where they may keep their things and conduct the following actions.