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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
| /*==============================================================*/
/* Nom de SGBD : MySQL 5.0 */
/* Date de cr�ation : 20/02/2023 10:33:17 PM */
/*==============================================================*/
drop table if exists ChambreEtat;
drop table if exists Chambres;
drop table if exists Clients;
drop table if exists Hotel;
drop table if exists Manager;
drop table if exists Personne;
drop table if exists Reservation;
drop table if exists ReservationEtat;
/*==============================================================*/
/* Table : ChambreEtat */
/*==============================================================*/
create table ChambreEtat
(
Libre varchar(254),
Occupee varchar(254),
Reservee varchar(254),
Autre varchar(254)
);
/*==============================================================*/
/* Table : Chambres */
/*==============================================================*/
create table Chambres
(
numC int not null,
id int not null,
nbLits int,
prix numeric(8,0),
etage int,
style varchar(254),
etat ChambreEtat,
primary key (numC)
);
/*==============================================================*/
/* Table : Clients */
/*==============================================================*/
create table Clients
(
idC int not null,
nom varchar(254),
prenom varchar(254),
tel int,
email varchar(254),
password varchar(254),
primary key (idC),
key AK_Identifiant_1 (idC)
);
/*==============================================================*/
/* Table : Hotel */
/*==============================================================*/
create table Hotel
(
id int not null,
nom varchar(254),
nbchambres int,
adresse varchar(254),
email varchar(254),
tel int,
primary key (id)
);
/*==============================================================*/
/* Table : Manager */
/*==============================================================*/
create table Manager
(
idM int not null,
nomM varchar(254),
prenomM varchar(254),
email varchar(254),
password varchar(254),
primary key (idM)
);
/*==============================================================*/
/* Table : Personne */
/*==============================================================*/
create table Personne
(
id int not null,
nom varchar(254),
prenom varchar(254),
primary key (id)
);
/*==============================================================*/
/* Table : Reservation */
/*==============================================================*/
create table Reservation
(
num int not null,
idC int not null,
idM int not null,
numC int not null,
id int not null,
jourArr datetime,
nbJours int,
jourDep datetime,
ReservEtat ReservationEtat,
primary key (num)
);
/*==============================================================*/
/* Table : ReservationEtat */
/*==============================================================*/
create table ReservationEtat
(
Confirmee varchar(254),
Annulee varchar(254)
);
alter table Chambres add constraint FK_Association_5 foreign key (id)
references Hotel (id) on delete restrict on update restrict;
alter table Reservation add constraint FK_Association_1 foreign key (idC)
references Clients (idC) on delete restrict on update restrict;
alter table Reservation add constraint FK_Association_2 foreign key (id)
references Personne (id) on delete restrict on update restrict;
alter table Reservation add constraint FK_Association_3 foreign key (idM)
references Manager (idM) on delete restrict on update restrict;
alter table Reservation add constraint FK_Association_4 foreign key (numC)
references Chambres (numC) on delete restrict on update restrict; |
Partager