You are on page 1of 31

versao 4.

DatabaseType PostgreSQL 8.3


Date 02/03/2018

1
ER diagram

2
Entity: Animal
Primary key constraint PK_Animal
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes SERIAL Yes
ani_numero No CHARACTER No
VARYING(40)
ani_nasc No DATE No
ani_morte No DATE No
ani_sexo No CHARACTER No
VARYING(40)
ani_mae No CHARACTER No
VARYING(40)
ani_pai No CHARACTER No
VARYING(40)
ani_peso No CHARACTER No
VARYING(40)
ani_idade No INTEGER No
ani_status No CHARACTER No
VARYING(40)
ani_nome No CHARACTER No
VARYING(40)
lote_id No INTEGER No
ani_serieNF No CHARACTER No
VARYING(40)
ani_nf No CHARACTER No
VARYING(40)
raca_id No INTEGER No
ani_pelagem No CHARACTER(40) No
ani_preco No MONEY No
ani_precoven No MONEY No
piq_id No INTEGER No
ani_desc No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Compra Identifying Animal Animal_Compra Zero Or More
Animal_Animal_Reprodu Identifying Animal Animal_Reproduc Zero Or More
cao ao
Animal_Animal_Vacinas Identifying Animal Animal_Vacinas Zero Or More
Animal_Animal_Venda Identifying Animal Animal_Venda Zero Or More
Animal_Pesagem Non Identifying Animal Pesagem Zero Or More
Animal_Semem Non Identifying Animal Semem Zero Or More
Lote_Animal Non Identifying Lote Animal Zero Or More
Piquete_Animal Non Identifying Piquete Animal Zero Or More
Raca_Animal Non Identifying Raca Animal Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ani_id)
Lote_Animal Foreign Key Table Constraint FOREIGN KEY (lote_id)
REFERENCES Lote(lote_id)

3
Piquete_Animal Foreign Key Table Constraint FOREIGN KEY (piq_id)
REFERENCES Piquete(piq_id)
PK_Animal Primary Key Table Constraint PRIMARY KEY (ani_id)
Raca_Animal Foreign Key Table Constraint FOREIGN KEY (raca_id)
REFERENCES Raca(raca_id)

Entity: Animal_Compra
Primary key constraint PK_Animal_Compra
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
comp_id Yes INTEGER Yes
ac_valor No MONEY Yes

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Compra Identifying Animal Animal_Compra Zero Or More
Compra_Animal_Compra Identifying Compra Animal_Compra Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ac_valor)
Not Null Column Constraint NOT NULL (ani_id)
Not Null Column Constraint NOT NULL (comp_id)
Animal_Animal_Compra Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
Compra_Animal_Compra Foreign Key Table Constraint FOREIGN KEY (comp_id)
REFERENCES Compra(comp_id)
PK_Animal_Compra Primary Key Table Constraint PRIMARY KEY (ani_id, comp_id)

Entity: Animal_Reproducao
Primary key constraint PK_Animal_Reproducao
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
rep_id Yes INTEGER Yes
ar_data No CHARACTER(40) No
ar_tipo No CHARACTER(40) No

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Reproduc Identifying Animal Animal_Reprodu Zero Or More
ao cao
Reproducao_Animal_Repr Identifying Reproducao Animal_Reprodu Zero Or More
oducao cao

Constraints:
4
Name Type Level Constraint
Not Null Column Constraint NOT NULL (rep_id)
Not Null Column Constraint NOT NULL (ani_id)
Animal_Animal_Reproducao Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Animal_Reproducao Primary Key Table Constraint PRIMARY KEY (ani_id, rep_id)
Reproducao_Animal_Reprodu Foreign Key Table Constraint FOREIGN KEY (rep_id)
cao REFERENCES Reproducao(rep_id)

Entity: Animal_Vacinas
Primary key constraint PK_Animal_Vacinas
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
vac_id Yes INTEGER Yes
av_data No CHARACTER Yes
VARYING(40)
av_quant No CHARACTER Yes
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Vacinas Identifying Animal Animal_Vacinas Zero Or More
Vacinas_Animal_Vacina Identifying Vacinas Animal_Vacinas Zero Or More
s

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (av_quant)
Not Null Column Constraint NOT NULL (ani_id)
Not Null Column Constraint NOT NULL (vac_id)
Not Null Column Constraint NOT NULL (av_data)
Animal_Animal_Vacinas Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Animal_Vacinas Primary Key Table Constraint PRIMARY KEY (ani_id, vac_id)
Vacinas_Animal_Vacinas Foreign Key Table Constraint FOREIGN KEY (vac_id)
REFERENCES Vacinas(vac_id)

Entity: Animal_Venda
Primary key constraint PK_Animal_Venda
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
vend_id Yes INTEGER Yes
av_valor No MONEY Yes
av_quant No INTEGER Yes

5
Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Venda Identifying Animal Animal_Venda Zero Or More
Venda_Animal_Venda Identifying Venda Animal_Venda Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (av_quant)
Not Null Column Constraint NOT NULL (ani_id)
Not Null Column Constraint NOT NULL (vend_id)
Not Null Column Constraint NOT NULL (av_valor)
Animal_Animal_Venda Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Animal_Venda Primary Key Table Constraint PRIMARY KEY (ani_id, vend_id)
Venda_Animal_Venda Foreign Key Table Constraint FOREIGN KEY (vend_id)
REFERENCES Venda(vend_id)

Entity: Cidade
Primary key constraint PK_Cidade
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
cid_id Yes SERIAL Yes
cid_nome No CHARACTER Yes
VARYING(40)
est_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Cidade_Pessoa Non Identifying Cidade Pessoa Zero Or More
Estado_Cidade Non Identifying Estado Cidade Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (cid_nome)
Not Null Column Constraint NOT NULL (cid_id)
Estado_Cidade Foreign Key Table Constraint FOREIGN KEY (est_id)
REFERENCES Estado(est_id)
PK_Cidade Primary Key Table Constraint PRIMARY KEY (cid_id)

Entity: Compra
Primary key constraint PK_Compra
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
comp_id Yes SERIAL Yes
comp_data No DATE Yes
comp_total No MONEY Yes

6
comp_nota No CHARACTER Yes
VARYING(40)
comp_serie_nota No CHARACTER Yes
VARYING(40)
comp_tipo No CHARACTER Yes
VARYING(40)
comp_formapag No CHARACTER Yes
VARYING(40)
pes_id No INTEGER No
comp_forma No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Compra_Animal_Compra Identifying Compra Animal_Compra Zero Or More
Compra_Compra_Insum Identifying Compra Compra_Insumo Zero Or More
os s
Compra_contas_pagar Non Identifying Compra contas_pagar Zero Or More
Pessoa_Compra Non Identifying Pessoa Compra Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (comp_formapag)
Not Null Column Constraint NOT NULL (comp_id)
Not Null Column Constraint NOT NULL (comp_data)
Not Null Column Constraint NOT NULL (comp_total)
Not Null Column Constraint NOT NULL (comp_nota)
Not Null Column Constraint NOT NULL (comp_serie_nota)
Not Null Column Constraint NOT NULL (comp_tipo)
Pessoa_Compra Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Compra Primary Key Table Constraint PRIMARY KEY (comp_id)

Entity: Compra_Insumos
Primary key constraint PK_Compra_Insumos
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
comp_id Yes INTEGER Yes
ins_id Yes INTEGER Yes
ci_valor No MONEY Yes
ci_quant No INTEGER Yes

Relationships:
Name Relationship type Parent Child Cardinality
Compra_Compra_Insum Identifying Compra Compra_Insumo Zero Or More
os s
Insumos_Compra_Insu Identifying Insumos Compra_Insumo Zero Or More
mos s

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ci_quant)
Not Null Column Constraint NOT NULL (comp_id)

7
Not Null Column Constraint NOT NULL (ins_id)
Not Null Column Constraint NOT NULL (ci_valor)
Compra_Compra_Insumos Foreign Key Table Constraint FOREIGN KEY (comp_id)
REFERENCES Compra(comp_id)
Insumos_Compra_Insumos Foreign Key Table Constraint FOREIGN KEY (ins_id)
REFERENCES Insumos(ins_id)
PK_Compra_Insumos Primary Key Table Constraint PRIMARY KEY (comp_id, ins_id)

Entity: contas_pagar
Primary key constraint PK_contas_pagar
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
pag_id Yes SERIAL Yes
pag_valor No MONEY Yes
pag_date No DATE No
pag_vencimento No DATE No
pag_pagamento No DATE No
pag_cond No CHARACTER No
VARYING(40)
pag_ordem No INTEGER No
comp_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Compra_contas_pagar Non Identifying Compra contas_pagar Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (pag_valor)
Not Null Column Constraint NOT NULL (pag_id)
Compra_contas_pagar Foreign Key Table Constraint FOREIGN KEY (comp_id)
REFERENCES Compra(comp_id)
PK_contas_pagar Primary Key Table Constraint PRIMARY KEY (pag_id)

Entity: contas_receber
Primary key constraint PK_contas_receber
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
rec_id Yes SERIAL Yes
rec_valor No MONEY Yes
rec_vencimento No DATE Yes
rec_pagamento No DATE Yes
rec_ordem No INTEGER Yes
rec_tipo No CHARACTER Yes
VARYING(40)
vend_id No INTEGER No

8
Relationships:
Name Relationship type Parent Child Cardinality
Venda_contas_receber Non Identifying Venda contas_receber Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (rec_tipo)
Not Null Column Constraint NOT NULL (rec_id)
Not Null Column Constraint NOT NULL (rec_valor)
Not Null Column Constraint NOT NULL (rec_vencimento)
Not Null Column Constraint NOT NULL (rec_pagamento)
Not Null Column Constraint NOT NULL (rec_ordem)
PK_contas_receber Primary Key Table Constraint PRIMARY KEY (rec_id)
Venda_contas_receber Foreign Key Table Constraint FOREIGN KEY (vend_id)
REFERENCES Venda(vend_id)

Entity: Estado
Primary key constraint PK_Estado
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
est_id Yes SERIAL Yes
est_nome No CHARACTER Yes
VARYING(40)
est_sigla No CHARACTER Yes
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Estado_Cidade Non Identifying Estado Cidade Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (est_sigla)
Not Null Column Constraint NOT NULL (est_id)
Not Null Column Constraint NOT NULL (est_nome)
PK_Estado Primary Key Table Constraint PRIMARY KEY (est_id)

Entity: Fisica
Primary key constraint PK_Fisica
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
fis_id Yes SERIAL Yes
fis_cpf No CHARACTER(40) Yes
fis_rg No CHARACTER(40) Yes
pes_id No INTEGER No

Relationships:
9
Name Relationship type Parent Child Cardinality
Pessoa_Fisica Non Identifying Pessoa Fisica Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (fis_rg)
Not Null Column Constraint NOT NULL (fis_id)
Not Null Column Constraint NOT NULL (fis_cpf)
Pessoa_Fisica Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Fisica Primary Key Table Constraint PRIMARY KEY (fis_id)

Entity: Insumos
Primary key constraint PK_Insumos
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ins_id Yes SERIAL Yes
ins_nome No CHARACTER Yes
VARYING(40)
ins_estoque No INTEGER Yes
ins_val No MONEY Yes
ti_id No INTEGER No
ti_nome No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Insumos_Compra_Insu Identifying Insumos Compra_Insumo Zero Or More
mos s
tipos_insumos_Insumos Non Identifying tipos_insumos Insumos Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ins_val)
Not Null Column Constraint NOT NULL (ins_id)
Not Null Column Constraint NOT NULL (ins_nome)
Not Null Column Constraint NOT NULL (ins_estoque)
PK_Insumos Primary Key Table Constraint PRIMARY KEY (ins_id)
tipos_insumos_Insumos Foreign Key Table Constraint FOREIGN KEY (ti_id, ti_nome)
REFERENCES tipos_insumos(ti_id,
ti_nome)

Entity: Juridica
Primary key constraint PK_Juridica
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
jur_id Yes SERIAL Yes
10
jur_cnpj No CHARACTER(40) Yes
jur_ie No CHARACTER(40) Yes
jur_mun No CHARACTER(40) Yes
pes_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Pessoa_Juridica Non Identifying Pessoa Juridica Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (jur_mun)
Not Null Column Constraint NOT NULL (jur_id)
Not Null Column Constraint NOT NULL (jur_cnpj)
Not Null Column Constraint NOT NULL (jur_ie)
Pessoa_Juridica Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Juridica Primary Key Table Constraint PRIMARY KEY (jur_id)

Entity: Lote
Primary key constraint PK_Lote
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
lote_id Yes SERIAL Yes
lote_nome No CHARACTER Yes
VARYING(40)
lote_ini No DATE No
lote_fim No CHARACTER(40) No
lote_quant No INTEGER No
lote_obs No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Lote_Animal Non Identifying Lote Animal Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (lote_nome)
Not Null Column Constraint NOT NULL (lote_id)
PK_Lote Primary Key Table Constraint PRIMARY KEY (lote_id)

Entity: Pesagem
Primary key constraint
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
pes_id Yes SERIAL Yes
11
pes_data No CHARACTER Yes
VARYING(40)
pes_peso No CHARACTER Yes
VARYING(40)
ani_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Pesagem Non Identifying Animal Pesagem Zero Or More

Constraints:
Name Type Level Constraint
Primary Key Table Constraint PRIMARY KEY (pes_id)
Not Null Column Constraint NOT NULL (pes_id)
Not Null Column Constraint NOT NULL (pes_data)
Not Null Column Constraint NOT NULL (pes_peso)
Animal_Pesagem Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)

Entity: Pessoa
Primary key constraint PK_Pessoa
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
pes_id Yes SERIAL Yes
pes_nome No CHARACTER Yes
VARYING(40)
pes_rua No CHARACTER Yes
VARYING(40)
pes_numero No CHARACTER Yes
VARYING(40)
pes_bairro No CHARACTER Yes
VARYING(40)
pes_complemento No CHARACTER No
VARYING(40)
pes_cep No CHARACTER No
VARYING(40)
pes_telefone No CHARACTER No
VARYING(40)
pes_celular No CHARACTER No
VARYING(40)
pes_email No CHARACTER No
VARYING(40)
pes_login No CHARACTER No
VARYING(40)
pes_senha No CHARACTER No
VARYING(40)
pes_nivel No INTEGER No
pes_tipo No INTEGER Yes
pes_contato No CHARACTER(40) No
pes_telContato No CHARACTER(40) No
cid_id No INTEGER No

Relationships:

12
Name Relationship type Parent Child Cardinality
Cidade_Pessoa Non Identifying Cidade Pessoa Zero Or More
Pessoa_Compra Non Identifying Pessoa Compra Zero Or More
Pessoa_Fisica Non Identifying Pessoa Fisica Zero Or More
Pessoa_Juridica Non Identifying Pessoa Juridica Zero Or More
Pessoa_Venda Non Identifying Pessoa Venda Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (pes_tipo)
Not Null Column Constraint NOT NULL (pes_id)
Not Null Column Constraint NOT NULL (pes_nome)
Not Null Column Constraint NOT NULL (pes_rua)
Not Null Column Constraint NOT NULL (pes_numero)
Not Null Column Constraint NOT NULL (pes_bairro)
Cidade_Pessoa Foreign Key Table Constraint FOREIGN KEY (cid_id)
REFERENCES Cidade(cid_id)
PK_Pessoa Primary Key Table Constraint PRIMARY KEY (pes_id)

Entity: Piquete
Primary key constraint PK_Piquete
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
piq_id Yes SERIAL Yes
piq_numero No INTEGER No
piq_lotacao No INTEGER No
piq_obs No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Piquete_Animal Non Identifying Piquete Animal Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (piq_id)
PK_Piquete Primary Key Table Constraint PRIMARY KEY (piq_id)

Entity: Raca
Primary key constraint
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
raca_id Yes SERIAL Yes
raca_nome No CHARACTER Yes
VARYING(40)

Relationships:
13
Name Relationship type Parent Child Cardinality
Raca_Animal Non Identifying Raca Animal Zero Or More

Constraints:
Name Type Level Constraint
Primary Key Table Constraint PRIMARY KEY (raca_id)
Not Null Column Constraint NOT NULL (raca_id)
Not Null Column Constraint NOT NULL (raca_nome)

Entity: Reproducao
Primary key constraint PK_Reproducao
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
rep_id Yes SERIAL Yes
red_data No DATE No
rep_relatorio No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Reproducao_Animal_Repr Identifying Reproducao Animal_Reprodu Zero Or More
oducao cao

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (rep_id)
PK_Reproducao Primary Key Table Constraint PRIMARY KEY (rep_id)

Entity: Semem
Primary key constraint PK_Semem
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
sem_id Yes SERIAL Yes
sem_amostra No CHARACTER Yes
VARYING(40)
sem_data No DATE Yes
sem_quant No INTEGER Yes
ani_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Semem Non Identifying Animal Semem Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (sem_quant)
Not Null Column Constraint NOT NULL (sem_id)
14
Not Null Column Constraint NOT NULL (sem_amostra)
Not Null Column Constraint NOT NULL (sem_data)
Animal_Semem Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Semem Primary Key Table Constraint PRIMARY KEY (sem_id)

Entity: tipos_insumos
Primary key constraint PK_tipos_insumos
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ti_id Yes SERIAL Yes
ti_nome Yes CHARACTER Yes
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
tipos_insumos_Insumos Non Identifying tipos_insumos Insumos Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ti_nome)
Not Null Column Constraint NOT NULL (ti_id)
PK_tipos_insumos Primary Key Table Constraint PRIMARY KEY (ti_id, ti_nome)

Entity: Vacinas
Primary key constraint PK_Vacinas
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
vac_id Yes SERIAL Yes
vac_nome No CHARACTER(40) No
vac_estoque No CHARACTER(40) No
vac_validade No DATE No
vac_preco No MONEY No

Relationships:
Name Relationship type Parent Child Cardinality
Vacinas_Animal_Vacina Identifying Vacinas Animal_Vacinas Zero Or More
s

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (vac_id)
PK_Vacinas Primary Key Table Constraint PRIMARY KEY (vac_id)

Entity: Venda
15
Primary key constraint PK_Venda
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
vend_id Yes SERIAL Yes
vend_data No DATE Yes
vend_total No MONEY Yes
vend_nota No CHARACTER Yes
VARYING(40)
vend_serie_nota No CHARACTER Yes
VARYING(40)
vend_formRec No CHARACTER Yes
VARYING(40)
pes_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Pessoa_Venda Non Identifying Pessoa Venda Zero Or More
Venda_Animal_Venda Identifying Venda Animal_Venda Zero Or More
Venda_contas_receber Non Identifying Venda contas_receber Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (vend_formRec)
Not Null Column Constraint NOT NULL (vend_id)
Not Null Column Constraint NOT NULL (vend_data)
Not Null Column Constraint NOT NULL (vend_total)
Not Null Column Constraint NOT NULL (vend_nota)
Not Null Column Constraint NOT NULL (vend_serie_nota)
Pessoa_Venda Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Venda Primary Key Table Constraint PRIMARY KEY (vend_id)

16
Entity details

17
Entity: Animal
Primary key constraint PK_Animal
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes SERIAL Yes
ani_numero No CHARACTER No
VARYING(40)
ani_nasc No DATE No
ani_morte No DATE No
ani_sexo No CHARACTER No
VARYING(40)
ani_mae No CHARACTER No
VARYING(40)
ani_pai No CHARACTER No
VARYING(40)
ani_peso No CHARACTER No
VARYING(40)
ani_idade No INTEGER No
ani_status No CHARACTER No
VARYING(40)
ani_nome No CHARACTER No
VARYING(40)
lote_id No INTEGER No
ani_serieNF No CHARACTER No
VARYING(40)
ani_nf No CHARACTER No
VARYING(40)
raca_id No INTEGER No
ani_pelagem No CHARACTER(40) No
ani_preco No MONEY No
ani_precoven No MONEY No
piq_id No INTEGER No
ani_desc No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Compra Identifying Animal Animal_Compra Zero Or More
Animal_Animal_Reprodu Identifying Animal Animal_Reproduc Zero Or More
cao ao
Animal_Animal_Vacinas Identifying Animal Animal_Vacinas Zero Or More
Animal_Animal_Venda Identifying Animal Animal_Venda Zero Or More
Animal_Pesagem Non Identifying Animal Pesagem Zero Or More
Animal_Semem Non Identifying Animal Semem Zero Or More
Lote_Animal Non Identifying Lote Animal Zero Or More
Piquete_Animal Non Identifying Piquete Animal Zero Or More
Raca_Animal Non Identifying Raca Animal Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ani_id)
Lote_Animal Foreign Key Table Constraint FOREIGN KEY (lote_id)
REFERENCES Lote(lote_id)

18
Piquete_Animal Foreign Key Table Constraint FOREIGN KEY (piq_id)
REFERENCES Piquete(piq_id)
PK_Animal Primary Key Table Constraint PRIMARY KEY (ani_id)
Raca_Animal Foreign Key Table Constraint FOREIGN KEY (raca_id)
REFERENCES Raca(raca_id)

Entity: Animal_Compra
Primary key constraint PK_Animal_Compra
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
comp_id Yes INTEGER Yes
ac_valor No MONEY Yes

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Compra Identifying Animal Animal_Compra Zero Or More
Compra_Animal_Compra Identifying Compra Animal_Compra Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ac_valor)
Not Null Column Constraint NOT NULL (ani_id)
Not Null Column Constraint NOT NULL (comp_id)
Animal_Animal_Compra Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
Compra_Animal_Compra Foreign Key Table Constraint FOREIGN KEY (comp_id)
REFERENCES Compra(comp_id)
PK_Animal_Compra Primary Key Table Constraint PRIMARY KEY (ani_id, comp_id)

Entity: Animal_Reproducao
Primary key constraint PK_Animal_Reproducao
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
rep_id Yes INTEGER Yes
ar_data No CHARACTER(40) No
ar_tipo No CHARACTER(40) No

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Reproduc Identifying Animal Animal_Reprodu Zero Or More
ao cao
Reproducao_Animal_Repr Identifying Reproducao Animal_Reprodu Zero Or More
oducao cao

Constraints:
19
Name Type Level Constraint
Not Null Column Constraint NOT NULL (rep_id)
Not Null Column Constraint NOT NULL (ani_id)
Animal_Animal_Reproducao Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Animal_Reproducao Primary Key Table Constraint PRIMARY KEY (ani_id, rep_id)
Reproducao_Animal_Reprodu Foreign Key Table Constraint FOREIGN KEY (rep_id)
cao REFERENCES Reproducao(rep_id)

Entity: Animal_Vacinas
Primary key constraint PK_Animal_Vacinas
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
vac_id Yes INTEGER Yes
av_data No CHARACTER Yes
VARYING(40)
av_quant No CHARACTER Yes
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Vacinas Identifying Animal Animal_Vacinas Zero Or More
Vacinas_Animal_Vacina Identifying Vacinas Animal_Vacinas Zero Or More
s

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (av_quant)
Not Null Column Constraint NOT NULL (ani_id)
Not Null Column Constraint NOT NULL (vac_id)
Not Null Column Constraint NOT NULL (av_data)
Animal_Animal_Vacinas Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Animal_Vacinas Primary Key Table Constraint PRIMARY KEY (ani_id, vac_id)
Vacinas_Animal_Vacinas Foreign Key Table Constraint FOREIGN KEY (vac_id)
REFERENCES Vacinas(vac_id)

Entity: Animal_Venda
Primary key constraint PK_Animal_Venda
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ani_id Yes INTEGER Yes
vend_id Yes INTEGER Yes
av_valor No MONEY Yes
av_quant No INTEGER Yes

20
Relationships:
Name Relationship type Parent Child Cardinality
Animal_Animal_Venda Identifying Animal Animal_Venda Zero Or More
Venda_Animal_Venda Identifying Venda Animal_Venda Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (av_quant)
Not Null Column Constraint NOT NULL (ani_id)
Not Null Column Constraint NOT NULL (vend_id)
Not Null Column Constraint NOT NULL (av_valor)
Animal_Animal_Venda Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Animal_Venda Primary Key Table Constraint PRIMARY KEY (ani_id, vend_id)
Venda_Animal_Venda Foreign Key Table Constraint FOREIGN KEY (vend_id)
REFERENCES Venda(vend_id)

Entity: Cidade
Primary key constraint PK_Cidade
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
cid_id Yes SERIAL Yes
cid_nome No CHARACTER Yes
VARYING(40)
est_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Cidade_Pessoa Non Identifying Cidade Pessoa Zero Or More
Estado_Cidade Non Identifying Estado Cidade Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (cid_nome)
Not Null Column Constraint NOT NULL (cid_id)
Estado_Cidade Foreign Key Table Constraint FOREIGN KEY (est_id)
REFERENCES Estado(est_id)
PK_Cidade Primary Key Table Constraint PRIMARY KEY (cid_id)

Entity: Compra
Primary key constraint PK_Compra
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
comp_id Yes SERIAL Yes
comp_data No DATE Yes
comp_total No MONEY Yes

21
comp_nota No CHARACTER Yes
VARYING(40)
comp_serie_nota No CHARACTER Yes
VARYING(40)
comp_tipo No CHARACTER Yes
VARYING(40)
comp_formapag No CHARACTER Yes
VARYING(40)
pes_id No INTEGER No
comp_forma No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Compra_Animal_Compra Identifying Compra Animal_Compra Zero Or More
Compra_Compra_Insum Identifying Compra Compra_Insumo Zero Or More
os s
Compra_contas_pagar Non Identifying Compra contas_pagar Zero Or More
Pessoa_Compra Non Identifying Pessoa Compra Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (comp_formapag)
Not Null Column Constraint NOT NULL (comp_id)
Not Null Column Constraint NOT NULL (comp_data)
Not Null Column Constraint NOT NULL (comp_total)
Not Null Column Constraint NOT NULL (comp_nota)
Not Null Column Constraint NOT NULL (comp_serie_nota)
Not Null Column Constraint NOT NULL (comp_tipo)
Pessoa_Compra Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Compra Primary Key Table Constraint PRIMARY KEY (comp_id)

Entity: Compra_Insumos
Primary key constraint PK_Compra_Insumos
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
comp_id Yes INTEGER Yes
ins_id Yes INTEGER Yes
ci_valor No MONEY Yes
ci_quant No INTEGER Yes

Relationships:
Name Relationship type Parent Child Cardinality
Compra_Compra_Insum Identifying Compra Compra_Insumo Zero Or More
os s
Insumos_Compra_Insu Identifying Insumos Compra_Insumo Zero Or More
mos s

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ci_quant)
Not Null Column Constraint NOT NULL (comp_id)

22
Not Null Column Constraint NOT NULL (ins_id)
Not Null Column Constraint NOT NULL (ci_valor)
Compra_Compra_Insumos Foreign Key Table Constraint FOREIGN KEY (comp_id)
REFERENCES Compra(comp_id)
Insumos_Compra_Insumos Foreign Key Table Constraint FOREIGN KEY (ins_id)
REFERENCES Insumos(ins_id)
PK_Compra_Insumos Primary Key Table Constraint PRIMARY KEY (comp_id, ins_id)

Entity: contas_pagar
Primary key constraint PK_contas_pagar
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
pag_id Yes SERIAL Yes
pag_valor No MONEY Yes
pag_date No DATE No
pag_vencimento No DATE No
pag_pagamento No DATE No
pag_cond No CHARACTER No
VARYING(40)
pag_ordem No INTEGER No
comp_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Compra_contas_pagar Non Identifying Compra contas_pagar Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (pag_valor)
Not Null Column Constraint NOT NULL (pag_id)
Compra_contas_pagar Foreign Key Table Constraint FOREIGN KEY (comp_id)
REFERENCES Compra(comp_id)
PK_contas_pagar Primary Key Table Constraint PRIMARY KEY (pag_id)

Entity: contas_receber
Primary key constraint PK_contas_receber
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
rec_id Yes SERIAL Yes
rec_valor No MONEY Yes
rec_vencimento No DATE Yes
rec_pagamento No DATE Yes
rec_ordem No INTEGER Yes
rec_tipo No CHARACTER Yes
VARYING(40)
vend_id No INTEGER No

23
Relationships:
Name Relationship type Parent Child Cardinality
Venda_contas_receber Non Identifying Venda contas_receber Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (rec_tipo)
Not Null Column Constraint NOT NULL (rec_id)
Not Null Column Constraint NOT NULL (rec_valor)
Not Null Column Constraint NOT NULL (rec_vencimento)
Not Null Column Constraint NOT NULL (rec_pagamento)
Not Null Column Constraint NOT NULL (rec_ordem)
PK_contas_receber Primary Key Table Constraint PRIMARY KEY (rec_id)
Venda_contas_receber Foreign Key Table Constraint FOREIGN KEY (vend_id)
REFERENCES Venda(vend_id)

Entity: Estado
Primary key constraint PK_Estado
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
est_id Yes SERIAL Yes
est_nome No CHARACTER Yes
VARYING(40)
est_sigla No CHARACTER Yes
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Estado_Cidade Non Identifying Estado Cidade Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (est_sigla)
Not Null Column Constraint NOT NULL (est_id)
Not Null Column Constraint NOT NULL (est_nome)
PK_Estado Primary Key Table Constraint PRIMARY KEY (est_id)

Entity: Fisica
Primary key constraint PK_Fisica
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
fis_id Yes SERIAL Yes
fis_cpf No CHARACTER(40) Yes
fis_rg No CHARACTER(40) Yes
pes_id No INTEGER No

Relationships:
24
Name Relationship type Parent Child Cardinality
Pessoa_Fisica Non Identifying Pessoa Fisica Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (fis_rg)
Not Null Column Constraint NOT NULL (fis_id)
Not Null Column Constraint NOT NULL (fis_cpf)
Pessoa_Fisica Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Fisica Primary Key Table Constraint PRIMARY KEY (fis_id)

Entity: Insumos
Primary key constraint PK_Insumos
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ins_id Yes SERIAL Yes
ins_nome No CHARACTER Yes
VARYING(40)
ins_estoque No INTEGER Yes
ins_val No MONEY Yes
ti_id No INTEGER No
ti_nome No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Insumos_Compra_Insu Identifying Insumos Compra_Insumo Zero Or More
mos s
tipos_insumos_Insumos Non Identifying tipos_insumos Insumos Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ins_val)
Not Null Column Constraint NOT NULL (ins_id)
Not Null Column Constraint NOT NULL (ins_nome)
Not Null Column Constraint NOT NULL (ins_estoque)
PK_Insumos Primary Key Table Constraint PRIMARY KEY (ins_id)
tipos_insumos_Insumos Foreign Key Table Constraint FOREIGN KEY (ti_id, ti_nome)
REFERENCES tipos_insumos(ti_id,
ti_nome)

Entity: Juridica
Primary key constraint PK_Juridica
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
jur_id Yes SERIAL Yes
25
jur_cnpj No CHARACTER(40) Yes
jur_ie No CHARACTER(40) Yes
jur_mun No CHARACTER(40) Yes
pes_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Pessoa_Juridica Non Identifying Pessoa Juridica Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (jur_mun)
Not Null Column Constraint NOT NULL (jur_id)
Not Null Column Constraint NOT NULL (jur_cnpj)
Not Null Column Constraint NOT NULL (jur_ie)
Pessoa_Juridica Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Juridica Primary Key Table Constraint PRIMARY KEY (jur_id)

Entity: Lote
Primary key constraint PK_Lote
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
lote_id Yes SERIAL Yes
lote_nome No CHARACTER Yes
VARYING(40)
lote_ini No DATE No
lote_fim No CHARACTER(40) No
lote_quant No INTEGER No
lote_obs No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Lote_Animal Non Identifying Lote Animal Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (lote_nome)
Not Null Column Constraint NOT NULL (lote_id)
PK_Lote Primary Key Table Constraint PRIMARY KEY (lote_id)

Entity: Pesagem
Primary key constraint
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
pes_id Yes SERIAL Yes
26
pes_data No CHARACTER Yes
VARYING(40)
pes_peso No CHARACTER Yes
VARYING(40)
ani_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Pesagem Non Identifying Animal Pesagem Zero Or More

Constraints:
Name Type Level Constraint
Primary Key Table Constraint PRIMARY KEY (pes_id)
Not Null Column Constraint NOT NULL (pes_id)
Not Null Column Constraint NOT NULL (pes_data)
Not Null Column Constraint NOT NULL (pes_peso)
Animal_Pesagem Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)

Entity: Pessoa
Primary key constraint PK_Pessoa
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
pes_id Yes SERIAL Yes
pes_nome No CHARACTER Yes
VARYING(40)
pes_rua No CHARACTER Yes
VARYING(40)
pes_numero No CHARACTER Yes
VARYING(40)
pes_bairro No CHARACTER Yes
VARYING(40)
pes_complemento No CHARACTER No
VARYING(40)
pes_cep No CHARACTER No
VARYING(40)
pes_telefone No CHARACTER No
VARYING(40)
pes_celular No CHARACTER No
VARYING(40)
pes_email No CHARACTER No
VARYING(40)
pes_login No CHARACTER No
VARYING(40)
pes_senha No CHARACTER No
VARYING(40)
pes_nivel No INTEGER No
pes_tipo No INTEGER Yes
pes_contato No CHARACTER(40) No
pes_telContato No CHARACTER(40) No
cid_id No INTEGER No

Relationships:

27
Name Relationship type Parent Child Cardinality
Cidade_Pessoa Non Identifying Cidade Pessoa Zero Or More
Pessoa_Compra Non Identifying Pessoa Compra Zero Or More
Pessoa_Fisica Non Identifying Pessoa Fisica Zero Or More
Pessoa_Juridica Non Identifying Pessoa Juridica Zero Or More
Pessoa_Venda Non Identifying Pessoa Venda Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (pes_tipo)
Not Null Column Constraint NOT NULL (pes_id)
Not Null Column Constraint NOT NULL (pes_nome)
Not Null Column Constraint NOT NULL (pes_rua)
Not Null Column Constraint NOT NULL (pes_numero)
Not Null Column Constraint NOT NULL (pes_bairro)
Cidade_Pessoa Foreign Key Table Constraint FOREIGN KEY (cid_id)
REFERENCES Cidade(cid_id)
PK_Pessoa Primary Key Table Constraint PRIMARY KEY (pes_id)

Entity: Piquete
Primary key constraint PK_Piquete
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
piq_id Yes SERIAL Yes
piq_numero No INTEGER No
piq_lotacao No INTEGER No
piq_obs No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Piquete_Animal Non Identifying Piquete Animal Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (piq_id)
PK_Piquete Primary Key Table Constraint PRIMARY KEY (piq_id)

Entity: Raca
Primary key constraint
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
raca_id Yes SERIAL Yes
raca_nome No CHARACTER Yes
VARYING(40)

Relationships:
28
Name Relationship type Parent Child Cardinality
Raca_Animal Non Identifying Raca Animal Zero Or More

Constraints:
Name Type Level Constraint
Primary Key Table Constraint PRIMARY KEY (raca_id)
Not Null Column Constraint NOT NULL (raca_id)
Not Null Column Constraint NOT NULL (raca_nome)

Entity: Reproducao
Primary key constraint PK_Reproducao
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
rep_id Yes SERIAL Yes
red_data No DATE No
rep_relatorio No CHARACTER No
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
Reproducao_Animal_Repr Identifying Reproducao Animal_Reprodu Zero Or More
oducao cao

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (rep_id)
PK_Reproducao Primary Key Table Constraint PRIMARY KEY (rep_id)

Entity: Semem
Primary key constraint PK_Semem
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
sem_id Yes SERIAL Yes
sem_amostra No CHARACTER Yes
VARYING(40)
sem_data No DATE Yes
sem_quant No INTEGER Yes
ani_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Animal_Semem Non Identifying Animal Semem Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (sem_quant)
Not Null Column Constraint NOT NULL (sem_id)
29
Not Null Column Constraint NOT NULL (sem_amostra)
Not Null Column Constraint NOT NULL (sem_data)
Animal_Semem Foreign Key Table Constraint FOREIGN KEY (ani_id)
REFERENCES Animal(ani_id)
PK_Semem Primary Key Table Constraint PRIMARY KEY (sem_id)

Entity: tipos_insumos
Primary key constraint PK_tipos_insumos
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
ti_id Yes SERIAL Yes
ti_nome Yes CHARACTER Yes
VARYING(40)

Relationships:
Name Relationship type Parent Child Cardinality
tipos_insumos_Insumos Non Identifying tipos_insumos Insumos Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (ti_nome)
Not Null Column Constraint NOT NULL (ti_id)
PK_tipos_insumos Primary Key Table Constraint PRIMARY KEY (ti_id, ti_nome)

Entity: Vacinas
Primary key constraint PK_Vacinas
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
vac_id Yes SERIAL Yes
vac_nome No CHARACTER(40) No
vac_estoque No CHARACTER(40) No
vac_validade No DATE No
vac_preco No MONEY No

Relationships:
Name Relationship type Parent Child Cardinality
Vacinas_Animal_Vacina Identifying Vacinas Animal_Vacinas Zero Or More
s

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (vac_id)
PK_Vacinas Primary Key Table Constraint PRIMARY KEY (vac_id)

Entity: Venda
30
Primary key constraint PK_Venda
name
Comment
Table options

Attributes:
Column name Primary key Data type Not NULL Comment
vend_id Yes SERIAL Yes
vend_data No DATE Yes
vend_total No MONEY Yes
vend_nota No CHARACTER Yes
VARYING(40)
vend_serie_nota No CHARACTER Yes
VARYING(40)
vend_formRec No CHARACTER Yes
VARYING(40)
pes_id No INTEGER No

Relationships:
Name Relationship type Parent Child Cardinality
Pessoa_Venda Non Identifying Pessoa Venda Zero Or More
Venda_Animal_Venda Identifying Venda Animal_Venda Zero Or More
Venda_contas_receber Non Identifying Venda contas_receber Zero Or More

Constraints:
Name Type Level Constraint
Not Null Column Constraint NOT NULL (vend_formRec)
Not Null Column Constraint NOT NULL (vend_id)
Not Null Column Constraint NOT NULL (vend_data)
Not Null Column Constraint NOT NULL (vend_total)
Not Null Column Constraint NOT NULL (vend_nota)
Not Null Column Constraint NOT NULL (vend_serie_nota)
Pessoa_Venda Foreign Key Table Constraint FOREIGN KEY (pes_id)
REFERENCES Pessoa(pes_id)
PK_Venda Primary Key Table Constraint PRIMARY KEY (vend_id)

31

You might also like