-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbdresto.sql
More file actions
101 lines (89 loc) · 2.21 KB
/
bdresto.sql
File metadata and controls
101 lines (89 loc) · 2.21 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
drop database resto;
create database resto;
use resto;
/*-------------gestionnaire------------*/
create table gestionnaire
(
idges varchar(10) not null,
nom varchar(250) not null,
prenom varchar(250) not null,
adresse varchar(250) not null,
telephone int not null,
dateNaissance varchar(250) not null,
login varchar(250) not null,
motDePasse varchar(8) not null,
numCIN varchar(20) not null,
primary key(idges)
);
/*-------------caissier------------*/
create table caissier
(
idCaissier varchar(10) not null,
nom varchar(250) not null,
prenom varchar(250) not null,
adresse varchar(250) not null,
telephone int not null,
dateNaissance varchar(250) not null,
login varchar(250) not null,
motDePasse varchar(8) not null,
numCIN varchar(20) not null,
primary key(idCaissier)
);
/*-------------plat------------*/
create table plat
(
intitule varchar(100) not null,
description varchar(100) not null,
idCaisse varchar(100) not null,
prix int not null,
categorie ENUM("fast-food","entree","assiete"),
foreign key(idCaisse) references caissier(idCaissier),
primary key(intitule)
);
/*-------------Boissons------------*/
create table Boissons
(
nom varchar(100) not null,
description varchar(100) not null,
format ENUM("gm","pm"),
prixJ int not null,
categorie ENUM("Naturel","Gazeuse","Local"),
primary key(nom)
);
/*-------------Commande------------*/
create table Commande
(
noCmd int not null,
dateCmd varchar(100) not null,
platCmde varchar(100) not null,
qPlat int not null,
jus varchar(100) not null,
nJus int not null,
primary key(noCmd),
foreign key(platCmde) references plat(intitule),
foreign key(jus) references Boissons(nom)
);
/*-------------platCommande
create table platCmd
(
nmCmd int not null,
nmPlat varchar(100) not null,
dateCmd varchar not null,
foreign key(nmCmdP) references Commande(noCmd),
foreign key(nmPlat) references plat(intitule),
primary key(nmCmd,nmPlat)
);
------------*/
/*-------------BoissonCommande
create table BsnCmd
(
nmCmd int not null,
nmJus varchar(100) not null,
dateCmd varchar not null,
foreign key(nmCmdJ) references Commande(noCmd),
foreign key(nmJus) references Boissons(nom),
primary key(nmCmd,nmJus)
);
------------*/
insert into caissier values("Ca17","Diom","Adja","GMbao",772549865,"Adja","Diom07");
)