Reputation: 43
I was trying to design tables to store settings like giving out rewards. The reward is given need to be limited based on some criteria. For example, Children with 2 stars and 25 points is rewarded 20 candies while children with 2 stars and 70 points is rewarded 65 candies.
Here is what I can think out of:
For the first approach, it is easy to find the data I need based on the criteria but if the criteria is too long, the column can take it and it will be harder for the system to separate the data.
For the second approach, maintaining is it easy but the parent table will become meaningless if the child does not exist. It is because they are depending on each other.
I would like to ask which is the best way to design the table for this approach. It should be ease for searching and maintaining. Is there any better way to do so?
Upvotes: 0
Views: 85
Reputation: 31785
If you don't ever need to look at "stars" or "points" individually, then Design 1 is the better approach.
If you do need to look at these criteria individually, then Design 2 is absolutely the better approach.
Upvotes: 1