1
I started to implement a bank, and I’m doubtful about the following:
I have 4 tables
- Person
- Client
- Functionary
- Administrator.
Cliente
and Funcionario
inherit from Pessoa
and Administrador
inherits from Funcionario
What I did was this.
Person contains the data: nome
,emai
,cpf
, etc., and Funcionario
and Administrador
only tell the PK
, done so, I need to include Agendamento
, and I need all these tables to consult Agendamento
.
How to proceed?
Can’t you have registered companies? Can’t the employee also be a customer? Inheritance is not usually a good idea, especially in a database. I have just answered on this: http://answall.com/q/191832/101. See an alternative: http://answall.com/q/14839/101 and http://answall.com/a/123499/101 and http://pt.stackoverflowcom/q/54177/101 and http:///pt.stackoverflowcom/q/80948/101 and finally http://en.stackoverflow.com/q/83702/101
– Maniero
maybe, I can make a profile table, where I would have the client, employee and administrator, separated by id and a user table, which would have relationship with this profile table, I think that solves my problem, and I don’t get duplicate attributes, thank you very much @bigown.
– Nicolas Guilherme Matheus
What would be the purpose of this relationship ?
– Edilson
Only identify who is who in the bank, and in the application give your proper 'dashboard' for each profile.
– Nicolas Guilherme Matheus