MYSQL. There is a table with users. It already has 22 columns. I want to add user achievements, this is + 5-6 columns. What's better, just add these columns to the main table, or create another table, and, if necessary, attach it?
- oneSeparate. Tables, like ordinary code, should not collect information about an entity to the maximum, but only a specific aspect - basic data in one table, achievements in another, family ties in the third, and hobbies in the fourth. Or perhaps it will be easier to use the NoSQL solution, where there is no question of columns. - etki
|
1 answer
Make a separate table for achievements with a foreign key to the user table for the userID field (so that achievements for a nonexistent user cannot be created)
then when adding / changing something related to achievements, you do not have to touch the user table.
- aha, that is is better all the same separate? - sinedsem
- answer: then when adding / changing something related to achievements you don’t have to touch the user table. - ProkletyiPirat
|