I have 4 types of users:
Admins
, normal user
, company
, service provider
Admins and normal user share some attributes (id .first name ,last name ,phone ,mail
) company and service provider share some attributes too (id .company name ,phone ,fax ,mail
).
They interact too with other entities in application to access some feature like post job or event or apply for it
Is it better to put them all in one user table like tbl_users or is it better to create separate table to every one ? or add to two tables one for (Admins and normal user) and other for ( company and service provider)
Best Answer
A simple design you can go for is to choose three tables
Table
MasterUser
Table
AdminNormalUser
Table
CompanyPorviderUser
This design will give you a unique Id to each user, no matter a Admin, Normal, Company or provider user, which is a requirement for application that will use these tables, And it will get rid of columns with
NULL
values.