Doubt PF and PJ database modeling

Asked

Viewed 672 times

2

I have a system that has a table called client, but this client can be Individual or Legal Person, in this case not to create a table for each of the client type PF and PJ, even because I have relationship with other tables as I create in the system such a table? For if I create anyway, there will be times when some field may be empty.

  • In fact the best is to make a PF and a PJ that inherits inheritance attributes from a person entity.

  • the most correct would be to create a table for each in my view, because Person Physics has different attributes of Juridical Person, as CPF for one is CNPJ for another, RG for one is State Registration for another, date of birth for one is date of foundation / creation for another, and so on. Create a parent person class and make them daughter classes by extending the necessary attributes

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.