-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreation Tables_projetpython.sql
More file actions
51 lines (45 loc) · 1.31 KB
/
Creation Tables_projetpython.sql
File metadata and controls
51 lines (45 loc) · 1.31 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
use `projetpython`;
drop table if exists Demandeur;
drop table if exists Admin;
drop table if exists produit;
drop table if exists commande;
drop table if exists SousCommande;
create table `projetpython`.`Demandeur`(
`id` int not null auto_increment,
`nom` varchar(25) not null,
`email` varchar (35) not null,
`mdp` varchar(40) not null,
`telephone` varchar(10) not null,
`nbprochesfoyer` int not null,
`nomsproches` varchar(150) not null,
`adresse` varchar(60) not null,
primary key (`id`));
create table `projetpython`.`Admin`(
`id` int not null auto_increment,
`nom` varchar(25) not null,
`email` varchar(35) not null,
`mdp` varchar(40) not null,
primary key (`id`));
create table `projetpython`.`Produit`(
`id` int not null auto_increment,
`nom` varchar(25) not null,
`categorie` varchar(25) not null,
`unite` varchar(5) not null,
`prix` double not null,
primary key (`id`));
CREATE TABLE `projetpython`.`Commande`(
`id` int not null auto_increment,
`idDemandeur` int not null,
foreign key(idDemandeur)
references Demandeur(id),
primary key (`id`));
create table `projetpython`.`SousCommande`(
`id` int not null auto_increment,
`idCommande` int not null,
`idProduit` int not null,
`quantiteDemandee`int not null,
foreign key(idCommande)
references Commande(id),
foreign key(idProduit)
references Produit(id),
primary key (`id`));