1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| CREATE TYPE etat_civil_type AS OBJECT
( NOM VARCHAR2(32), PRENOM VARCHAR2(20) )
/
CREATE TYPE adresse_type AS OBJECT
( ADR1 VARCHAR2(32), ADR2 VARCHAR2(32), ADR3 VARCHAR2(32), CP NUMBER(5), VILLE VARCHAR2(32) )
/
CREATE TYPE personne_type AS OBJECT
( NUM_SS VARCHAR2(20),
etat_civil etat_civil_typ,
adresse adresse_type,
STATUT VARCHAR2(15)
)
/
CREATE TABLE personnel OF personne_type
(
CONSTRAINT pk_num_ss PRIMARY KEY (NUM_SS),
CONSTRAINT df_statut STATUT DEFAULT 'Interne',
CONSTRAINT nn_ville CHECK (adresse.VILLE NOT NULL),
CONSTRAINT nn_nom CHECK (etat_civil.NOM IS NOT NULL),
CONSTRAINT un_nom UNIQUE (etat_civil.NOM),
CONSTRAINT ck_cp CHECK (adresse.cp BETWEEN 1000 and 99000)
)
/ |