Forum Moderators: coopster
I would like to know the idea regarding db design for the following case:
CASE:
There are three types of users(say Customer, Business User and Personnel)
They have some parts common like first name, last name, email etc. Users like business user and personnel
have login access and permission types.
I would like to know:
1> whether to design three tables for the three types of users with all the required fields.
2> or one table with extra field user_type (for common fields).and other table for login infos and permission types.
Which one is better and why ? I would like to know the opinions of the forumians.
It depends on how different the three entities are. If you've got a bunch of fields of data that you track for one but not the others, it probably deserves its own table. If all three are practically identical except for a permission level and maybe another field or two and all are going to be hitting the same scripts, the scripting will be easier if you're consulting the same table for all, and you can reuse code more - whether it's copy/paste or writing common functions to rehandle the data. As for the customers, they have a permission type, too - a permission of none ;)