36 lines
823 B
SQL
36 lines
823 B
SQL
CREATE TABLE Buveur (
|
|
NumBuveur NUMBER PRIMARY KEY,
|
|
Nom VARCHAR2(25) NOT NULL,
|
|
Prenom VARCHAR2(25),
|
|
Ville VARCHAR2(30) NOT NULL
|
|
);
|
|
|
|
CREATE TABLE Viticulteur (
|
|
NumVitic NUMBER PRIMARY KEY,
|
|
Nom VARCHAR2(25) NOT NULL,
|
|
Prenom VARCHAR2(25),
|
|
Ville VARCHAR2(30) NOT NULL
|
|
);
|
|
|
|
CREATE TABLE Vin (
|
|
NumVin NUMBER PRIMARY KEY,
|
|
cru VARCHAR2(15) NOT NULL,
|
|
Millesime INT NOT NULL,
|
|
Region VARCHAR2(15) NOT NULL,
|
|
NumVitic NUMBER REFERENCES Viticulteur
|
|
);
|
|
|
|
CREATE TABLE Commande (
|
|
NumCom NUMBER PRIMARY KEY,
|
|
NumBuveur NUMBER REFERENCES Buveur,
|
|
NumVin NUMBER REFERENCES Vin,
|
|
Qtte INT NOT NULL,
|
|
DateCom DATE NOT NULL
|
|
);
|
|
|
|
CREATE TABLE Livraison (
|
|
NumCom NUMBER REFERENCES Commande NOT NULL,
|
|
Qte NUMBER NOT NULL,
|
|
DateLiv DATE,
|
|
PRIMARY KEY(NumCom, DateLiv)
|
|
); |