1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| create table Ouverier (
id_ouv int NOT NULL primary key ,
nom_ouv varchar(20) ,);
create table Responsable(
id_res int NOT NULL ,
id_ouv int NOT NULL references Ouverier(id_ouv),
nom_ouv varchar(20) ,
nom_res varchar(20),
constraint pk1 primary key (id_res,id_ouv), );
create table Employee(
id_emp int NOT NULL ,
id_ouv int NOT NULL references Ouverier(id_ouv),
nom_ouv varchar(20) ,
nom_emp varchar(20),
constraint pk2 primary key (id_emp,id_ouv),
);
create table Entreprise(
id_ent int NOT NULL primary key,
nom_ent varchar(20),
);
create table Commande(
id_comm int NOT NULL primary key,
);
create table Fournisseur(
id_four int NOT NULL primary key,
nom_four varchar(20),
);
create table Camion(
matricule int NOT NULL primary key,
);
create table Produit(
id_pdt int NOT NULL primary key,
nom_pdt varchar(20) ,
quantite int,
seuil_min int,
id_ouv int REFERENCES Ouverier(id_ouv),
id_res int REFERENCES Responsable(id_res),
code_barre int REFERENCES Lot(code_barre),
);
commit; |
Partager