Questions about inserting this template

5

I'm developing an application that needs to have both an individual and a legal person, I would like help finding out what the insert of that model would look like

If I want to register an individual, I should make two insert ?

    
asked by anonymous 25.10.2016 / 12:15

1 answer

2

Yes. First you insert into the parent table (tbPerform) and then into the child table (tbPerformance or tbPerformance).

INSERT INTO tbPessoa ('nmPessoa', 'dsEmail')
VALUES ('João', '[email protected]');

INSERT INTO tbPessoaFisica ('cdCpf', 'idPessoa')
VALUES ('78945698745', 'pk do insert de cima');
    
25.10.2016 / 13:27