Commit e6f8bfbb authored by Evenson Jeunesse's avatar Evenson Jeunesse
Browse files

Update RO_2.sql

parent 302f64d8
......@@ -24,10 +24,10 @@ CREATE TABLE RefEspece OF TRefEspece( SCOPE FOR (espece) IS Espece);
CREATE OR REPLACE TYPE ListRefEspece AS TABLE OF TRefEspece;
/
------------------------------------------------------
CREATE OR REPLACE TYPE TMedicament AS OBJECT(
nomMolecule VARCHAR(50),
effets VARCHAR(255),
......@@ -78,46 +78,53 @@ CREATE TABLE RefTraitement OF TRefTraitement( SCOPE FOR (traitement) IS Traiteme
CREATE OR REPLACE TYPE ListRefTraitement AS TABLE OF TRefTraitement;
/
----------------------------------------------------------------
CREATE OR REPLACE TYPE TAnimal AS OBJECT (
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
traitements ListRefTraitement
);
/
CREATE OR REPLACE TYPE LAnimal OF TAnimal;
CREATE TYPE LAnimaux AS TABLE OF TAnimal;
/
CREATE OR REPLACE TYPE TClients AS OBJECT (
id INTEGER,
telephone INTEGER,
nom VARCHAR(50),
prenom VARCHAR(50),
date_naissance DATE,
adresse VARCHAR(255)
);
CREATE TABLE Clients OF TCLients(
--CREATE TABLE Animal OF TAnimal(
--nom NOT NULL,
--dernierPoids NOT NULL,
--derniereTaille NOT NULL,
--date_naissance NOT NULL,
---PRIMARY KEY (id),
--FOREIGN KEY (espece) REFERENCES Especes(nom),
---CHECK (dernierPoids > 0),
---CHECK (derniereTaille > 0),
---CHECK (date_naissance > 1900),
---espece NOT NULL,
--SCOPE FOR espece IS Espece
--) NESTED TABLE traitements STORE AS NT_Animal_Traitements;
--/
CREATE TABLE Clients(
id INTEGER,
telephone INTEGER NOT NULL,
nom VARCHAR(50) NOT NULL,
prenom VARCHAR(50) NOT NULL,
date_naissance DATE NOT NULL,
adresse VARCHAR(255) NOT NULL,
animaux LAnimaux,
PRIMARY KEY (id),
telephone NOT NULL,
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);
) NESTED TABLE animaux STORE AS NT_Client_Animaux (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