Commit 0a1dd7a7 authored by Gaetan Carabetta's avatar Gaetan Carabetta

Update foreign key Assis Veter

parent c6734372
......@@ -16,7 +16,8 @@ CREATE TABLE Assistant(
adresse VARCHAR(100) NOT NULL,
numero NUMERIC(10) NOT NULL,
specialite VARCHAR(30),
PRIMARY KEY(idAssistant)
PRIMARY KEY(idAssistant),
FOREIGN KEY(specialite) REFERENCES ClasseEspece(nomClasse)
);
CREATE TABLE Veterinaire(
......@@ -27,7 +28,8 @@ CREATE TABLE Veterinaire(
adresse VARCHAR(100) NOT NULL,
numero NUMERIC(10) NOT NULL,
specialite VARCHAR(30),
PRIMARY KEY(idVeterinaire)
PRIMARY KEY(idVeterinaire),
FOREIGN KEY(specialite) REFERENCES ClasseEspece(nomClasse)
);
CREATE TABLE ClasseEspece(
......@@ -54,7 +56,7 @@ CREATE TABLE Animal(
FOREIGN KEY (idClient) REFERENCES Client(idClient),
FOREIGN KEY (especeNom) REFERENCES Espece(nomEspece),
CHECK (POIDS > 0),
CHECK (TAILLE > 0)
CHECK (TAILLE > 0)
);
CREATE TABLE Medicament(
......@@ -75,9 +77,9 @@ CREATE TABLE Traitement(
CREATE TABLE Espece_Med(
nomEspece VARCHAR(30) NOT NULL,
nomMolec VARCHAR(30) NOT NULL,
PRIMARY KEY(nomEspece, nomMolec)
FOREIGN KEY(nomEspece) REFERENCES Espece(nomEspece),
FOREIGN KEY(nomMolec) REFERENCES Medicament(nomMolec),
PRIMARY KEY(nomEspece, nomMolec)
);
CREATE TABLE Posologie(
......@@ -87,8 +89,8 @@ CREATE TABLE Posologie(
duree INT NOT NULL,
nbJourna INT NOT NULL,
PRIMARY KEY(idAnimal, nomMolec, debut),
CHECK (duree > 0),
CHECK (nbJourna > 0)
CHECK (duree > 0),
CHECK (nbJourna > 0)
);
/* Methodes */
......
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