So I'm creating a web app with different user types that can come from different countries. Examples of the user types would be company
, staff
etc. Where a company would have a company_name
field and staff would not.
In the users
database I'm wondering if it's a good idea to implement a one table per column approach i.e for each user attribute there would be a table with a foreign key which would be the user_id
and a value
for the attribute value.
eg.
users.company_name =
id(PK), | user_id(FK) | 'company_name'
1 | 1 | company 1
users.email =
id(PK), | user_id(FK) | 'email'
1 | 1 | user@email.com
The same could be applied to an address
database where different countries' addresses have different values.
Opinions?