I have to design a database that is capable of storing the data of a user and its Role in a web page, these roles are: Worker, Employer and Administrator.
What confuses me is how to make those relationships. Mainly I made some relationships between:
--------------------------------------------------
| Trabajador | 0,1 ------ 0,n --->> | Rol |
--------------------------------------------------
Likewise with the employer entity
--------------------------------------------------
|Empleador | 0,1 ------- 0,n --->> |Rol|
--------------------------------------------------
The other way to do it would be Asi:
| Usuario |-- 0,1--------- 0,n --->> |Rol|
By creating a User Entity, users' data can be saved along with a column called user_roller where the ID of the table or Role entity is.
My question is, if done in the second way, how can users have 2 roles? Should they have two different accounts for each role?
Ó Is there a better way to make that kind of relationship?
I hope I have expired. I would appreciate any help, push or scolding. Thanks.