I have a game, and when an action is completed, I need to give the user an item. Items will each have a unique id. Each action is also stored and described in their own table. Each action will have its own reward, but I want an action to be able to give a varying amount of items, possibly none.
So far I have three approaches:
- Set three columns in each action row for item ids. The downsides is that it leaves redundant empty cells when the act doesn't give three items, but the upside is that it's simple.
- Set only one column that holds multiple values separated by spaces. It's a little less redundant than the above, but it requires a little more processing for separating the values.
- Make a new table for rewards and set each row with an item and an action that the item is for. Then, when the action is completed, it calls all rows with the action id from the rewards table. This has nearly zero redundancy but requires an extra query.
Which approach do you think would be the best to use?