J'ajoute les NOT NULL pour les Primary key

parent bc487006
CREATE TABLE Client(
idClient INT,
idClient INT NOT NULL,
nom VARCHAR(30) NOT NULL,
prenon VARCHAR(30) NOT NULL,
ddn DATE NOT NULL,
......@@ -9,7 +9,7 @@ CREATE TABLE Client(
);
CREATE TABLE Assistant(
idAssistant INT,
idAssistant INT NOT NULL,
nom VARCHAR(30) NOT NULL,
prenon VARCHAR(30) NOT NULL,
ddn DATE NOT NULL,
......@@ -19,7 +19,7 @@ CREATE TABLE Assistant(
);
CREATE TABLE Veterinaire(
idVeterinaire INT,
idVeterinaire INT NOT NULL,
nom VARCHAR(30) NOT NULL,
prenon VARCHAR(30) NOT NULL,
ddn DATE NOT NULL,
......@@ -29,24 +29,24 @@ CREATE TABLE Veterinaire(
);
CREATE TABLE ClasseEspece(
nomClasse VARCHAR(30),
nomClasse VARCHAR(30) NOT NULL,
PRIMARY KEY(nomClasse)
);
CREATE TABLE Espece(
nomEspece VARCHAR(30),
nomClasse VARCHAR(30),
nomEspece VARCHAR(30) NOT NULL,
nomClasse VARCHAR(30) NOT NULL,
PRIMARY KEY(nomEspece),
FOREIGN KEY(nomClasse) REFERENCES Classe_espece(nomClasse)
);
CREATE TABLE Animal(
idAnimal INT,
idAnimal INT NOT NULL,
nom VARCHAR(30) NOT NULL,
poids REAL NOT NULL,
taille REAL NOT NULL,
naissance DATE,
idClient INT,
idClient INT NOT NULL,
especeNom VARCHAR(30),
PRIMARY KEY(idAnimal),
FOREIGN KEY (idClient) REFERENCES Client(idClient),
......@@ -54,31 +54,31 @@ CREATE TABLE Animal(
);
CREATE TABLE Medicament(
nomMolec VARCHAR(30),
nomMolec VARCHAR(30) NOT NULL,
description VARCHAR(200) NOT NULL,
PRIMARY KEY(nomMolec)
);
CREATE TABLE Traitement(
idTraitement INT,
idAnimal INT,
idVeterinaire INT,
idTraitement INT NOT NULL,
idAnimal INT NOT NULL,
idVeterinaire INT NOT NULL,
PRIMARY KEY(idTraitement),
FOREIGN KEY(idVeterinaire) REFERENCES Veterinaire(idVeterinaire),
FOREIGN KEY(idAnimal) REFERENCES Animal(idAnimal)
);
CREATE TABLE Espece_Med(
nomEspece VARCHAR(30),
nomMolec VARCHAR(30),
nomEspece VARCHAR(30) NOT NULL,
nomMolec VARCHAR(30) NOT NULL,
FOREIGN KEY(nomEspece) REFERENCES Espece(nomEspece),
FOREIGN KEY(nomMolec) REFERENCES Medicament(nomMolec)
);
CREATE TABLE Posologie(
idAnimal INT REFERENCES Animal(idAnimal),
nomMolec VARCHAR(30) REFERENCES Medicament(nomMolec),
debut DATE,
idAnimal INT NOT NULL REFERENCES Animal(idAnimal),
nomMolec VARCHAR(30) NOT NULL REFERENCES Medicament(nomMolec),
debut DATE NOT NULL,
duree INT NOT NULL,
nbJourna INT NOT NULL,
PRIMARY KEY(idAnimal, nomMolec, debut)
......
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