Commit 4ce3f16b authored by Xiang Li's avatar Xiang Li
Browse files

Update RO_2.sql

parent 9529c365
......@@ -80,6 +80,21 @@ CREATE OR REPLACE TYPE ListRefTraitement AS TABLE OF TRefTraitement;
----------------------------------------------------------------
CREATE OR REPLACE TYPE TAnimal AS OBJECT (
id INTEGER,
nom VARCHAR(30),
dernierPoids INTEGER,
derniereTaille INTEGER,
date_naissance INTEGER,
espece REF TEspece,
traitements ListRefTraitement,
client REF TClients
);
/
CREATE OR REPLACE TYPE LAnimal OF TAnimal;
/
CREATE OR REPLACE TYPE TClients AS OBJECT (
id INTEGER,
telephone INTEGER,
......@@ -96,37 +111,13 @@ nom NOT NULL,
prenom NOT NULL,
date_naissance NOT NULL,
adresse NOT NULL,
animaux Lanimaux,
CHECK (telephone > 100000000 AND telephone < 999999999)
);
)
NESTED TABLE animaux STORE AS NT_Animaux(NESTED TABLE traitements STORE AS NT_Animaux_Traitements);
/
CREATE OR REPLACE TYPE TAnimal AS OBJECT (
id INTEGER,
nom VARCHAR(30),
dernierPoids INTEGER,
derniereTaille INTEGER,
date_naissance INTEGER,
espece REF TEspece,
traitements ListRefTraitement,
client REF TClients
);
/
CREATE TABLE Animal OF TAnimal(
nom NOT NULL,
dernierPoids NOT NULL,
derniereTaille NOT NULL,
date_naissance NOT NULL,
PRIMARY KEY (id),
CHECK (dernierPoids > 0),
CHECK (derniereTaille > 0),
client NOT NULL,
SCOPE FOR (client) IS Clients,
espece NOT NULL,
SCOPE FOR (espece) IS Espece
) NESTED TABLE traitements STORE AS NT_Animal_Traitements;
/
CREATE TABLE Veterinaires(
id INTEGER,
telephone INTEGER NOT NULL,
......
Supports Markdown
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