which database design is better? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

which database design is better?

let say I have 3 different user type (eg: user, shop, admin) and all 3 required similar information. option 1 : make 3 different table for each user type or option 2 : use 1 table but add another column to differentiate each user type which one is better or both is okay depending the situation and if so under which circumstances should I use each option? any other suggestion is much appreciated?

30th Jan 2020, 5:33 PM
Muhd Adam Mohd
Muhd Adam Mohd - avatar
2 Answers
+ 4
If the columns for all 3 are completely different then I would suggest you to go for making 3 separate tables. But if they all have only a single column that is different then probably you should go for a single table. This would help you see the output clearly and all at one place by using simple queries. Whereas for different tables you must use joins to combine the results of the table.
30th Jan 2020, 5:56 PM
Avinesh
Avinesh - avatar
0
1
2nd Feb 2020, 2:11 PM
Shamil K Shamil K