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
| /*
Created 08/03/2006
Modified 08/03/2006
Project Student
Model 1
Company Developpez.com
Author Maxence HUBICHE
Version 1.0.0
Database mySQL 4.0
*/
Create table tblChambre (
chbID Int UNSIGNED NOT NULL,
chbNom Char(20),
tchID Char(1) NOT NULL,
UNIQUE (chbID),
Primary Key (chbID)) TYPE = MyISAM
ROW_FORMAT = Default;
Create table tblTypeDeChambre (
tchID Char(1) NOT NULL,
tchLibelle Char(20),
Primary Key (tchID)) TYPE = MyISAM
ROW_FORMAT = Default;
Create table tblTarif (
trfID Char(1) NOT NULL,
tchID Char(1) NOT NULL,
trfLibelle Char(20) NOT NULL,
trfMontant Decimal(5,2) NOT NULL,
trfNbPersonnesMax Tinyint,
trfNbPersonnesMin Tinyint,
UNIQUE (trfID),
Primary Key (trfID)) TYPE = MyISAM
ROW_FORMAT = Default;
Create table tblReservations (
resID Bigint UNSIGNED NOT NULL AUTO_INCREMENT,
cliID Bigint UNSIGNED NOT NULL,
resDateCommande Date NOT NULL,
resAdresseFacturation1 Char(50),
resAdressefacturation2 Char(20),
resCPFacturation1 Char(5),
resVilleFacturation Char(20),
resPaysFacturation Char(20),
UNIQUE (resID),
Primary Key (resID)) TYPE = MyISAM
ROW_FORMAT = Default;
Create table tblClients (
cliID Bigint UNSIGNED NOT NULL AUTO_INCREMENT,
cliNom Char(50) NOT NULL,
cliAdresse1 Char(50) NOT NULL,
cliAdresse2 Char(50),
cliCP Char(5) NOT NULL,
cliVille Char(20) NOT NULL,
cliPays Char(20),
UNIQUE (cliID),
Primary Key (cliID)) TYPE = MyISAM
ROW_FORMAT = Default;
Create table tblDatesDeReservation (
drsID Int NOT NULL AUTO_INCREMENT,
chbID Int UNSIGNED NOT NULL,
trfID Char(1) NOT NULL,
resID Bigint UNSIGNED NOT NULL,
drsDateResaDebut Date NOT NULL,
drsDateResaFin Date NOT NULL,
drsNbPersonnes Tinyint NOT NULL,
UNIQUE (drsID),
Primary Key (drsID)) TYPE = MyISAM
ROW_FORMAT = Default;
Alter table tblDatesDeReservation add Index IX_Resa2_Chambres_ (chbID);
Alter table tblDatesDeReservation add Foreign Key (chbID) references tblChambre (chbID) on delete restrict on update cascade;
Alter table tblChambre add Index IX_D_finir_type_de_chambre (tchID);
Alter table tblChambre add Foreign Key (tchID) references tblTypeDeChambre (tchID) on delete restrict on update cascade;
Alter table tblTarif add Index IX_D_finir_tarif_par_type_de_chambre (tchID);
Alter table tblTarif add Foreign Key (tchID) references tblTypeDeChambre (tchID) on delete restrict on update cascade;
Alter table tblDatesDeReservation add Index IX_Relationship5 (trfID);
Alter table tblDatesDeReservation add Foreign Key (trfID) references tblTarif (trfID) on delete restrict on update cascade;
Alter table tblDatesDeReservation add Index IX_Resa1_Dates_ (resID);
Alter table tblDatesDeReservation add Foreign Key (resID) references tblReservations (resID) on delete restrict on update cascade;
Alter table tblReservations add Index IX_Faire_R_servation (cliID);
Alter table tblReservations add Foreign Key (cliID) references tblClients (cliID) on delete restrict on update cascade; |
Partager