c. Commune
SQL> create table commune(
codecom varchar2(10) primary key,
nomcom varchar2(32) not null,
codeparquet varchar2(10),
constraint fk_pq_com foreign key(codeparquet) references
pqadmin.parquet);
d. Personne
SQL>create table personne(
id_personne integer not null,
numidentif varchar2(20) default '000' not null,
nom varchar2(32) default 'x' not null,
postnom varchar2(32),
prenom varchar2(32),
typersonne number(1,0),
datenaiss date,
datecreation date,
aptitude number(1,0),
genre char(1),
formejurid varchar2(32),
villenaiss varchar2(32),
nationalite varchar2(32),
codecom varchar2(10),
constraint fk_pq_perso foreign key(codecom) references
pqadmin.commune,
constraint pk_pq_perso primary
key(id_personne,numidentif));
e. Mandat
SQL> create table mandat(
id_mandat integer primary key,
datenvoie date,
typemandat varchar2(32),
libelmandat varchar2(128),
codeparexp varchar2(10),
codepardes varchar2(10),
id_personne integer,
numidentif varchar2(20),
constraint fk1_pq_mandat foreign key(codeparexp) references
pqadmin.parquet,
constraint fk2_pq_mandat foreign key(codepardes) references
pqadmin.parquet,
constraint fk3_pq_mandat foreign key(id_personne,numidentif)
references pqadmin.personne);
f. Personnel
SQL> create table personnel(
matricule varchar2(16) primary key,
nomperso varchar2(32),
postperso varchar2(32),
service varchar2(3) ,
grade varchar2(32),
fonction varchar2(3),
codeparquet varchar2(10),
constraint fk_pq_personnel foreign key(codeparquet)
references pqadmin.parquet);
g. Dossier
SQL>create table dossier(
id_dossier integer primary key,
dateinscript date default sysdate,
datearrest date,
observation varchar2(128),
ordonnace varchar2(128),
mdprevent number(1,0),
codeparquet varchar2(10),
matricule varchar2(16),
article number(4,0),
constraint fk1_pq_dossier foreign key(codeparquet) references
pqadmin.parquet,
constraint fk2_pq_dossier foreign key(matricule) references
pqadmin.personnel,
constraint fk3_pq_dossier foreign key(article) references
pqadmin.infraction);
h. Acte
SQL> create table acte(
num_ordre integer primary key,
daterecept date default sysdate,
num_acte varchar2(20),
typeacte number(1,0) default 1,
objet varchar2(64),
matricule varchar2(16),
id_dossier integer,
id_personne integer,
numidentif varchar2(20),
constraint fk1_pq_acte foreign key(matricule) references
pqadmin.personnel,
constraint fk2_pq_acte foreign key(id_dossier) references
pqadmin.dossier,
constraint fk3_pq_acte foreign key(id_personne,numidentif)
references personne) ;
|