Commit 2ca01e3e authored by Gaetan Carabetta's avatar Gaetan Carabetta
parents bb34da8c 4abf2ea2
CREATE OR REPLACE TYPE traitement AS OBJECT (
id_traitement NUMBER NOT NULL,
debut DATE NOT NULL,
duree NUMBER NOT NULL,
quantite NUMBER NOT NULL,
veterinaire VARCHAR(30) NOT NULL,
medicament VARCHAR(30) NOT NULL
);
/
CREATE OR REPLACE TYPE listTraitements AS TABLE OF traitement;
/
CREATE OR REPLACE TYPE animal AS OBJECT (
id_animal NUMBER NOT NULL,
nom VARCHAR(20),
poid FLOAT,
TAILLE FLOAT,
dn DATE,
traitements listTraitements NOT NULL,
PRIMARY KEY (id_animal)
) NESTED TABLE listTraitement STORED AS l_traitements;
/
CREATE OR REPLACE TYPE listeAnimals AS TABLE OF animal;
/
CREATE OR REPLACE TABLE clients (
id_client NUMBER NOT NULL,
nom VARCHAR(20) NOT NULL,
prenom VARCHAR(20) NOT NULL,
dn DATE NOT NULL,
adresse VARCHAR(50) NOT NULL,
n_tel NUMBER NOT NULL,
animal listeAnimals NOT NULL,
PRIMARY KEY(id_client)
)NESTED TABLE listeAnimals STORED AS l_animals;
/
CREATE OR REPLACE TABLE classeEspece(
classeEscpece VARCHAR(30) NOT NULL PRIMARY KEY
);
/
CREATE OR REPLACE TABLE espece(
classeEspece VARCHAR(30) NOT NULL,
espece VARCHAR(20) NOT NULL,
PRIMARY KEY(espece),
FOREIGN KEY (classeEspece) REFERENCES classeEspece(classeEspece)
);
/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment