Hotelbd SQL
Hotelbd SQL
/*==============================================================*/
/* Table : CATEGORIES */
/*==============================================================*/
create table CATEGORIES
(
CODE_CATEGORIE bool not null,
DESCRIPTION_ longtext not null,
primary key (CODE_CATEGORIE)
);
/*==============================================================*/
/* Table : CHAMBRES */
/*==============================================================*/
create table CHAMBRES
(
NUM_CHAMBRE int not null,
NUM_HOTEL longtext not null,
CODE_CATEGORIE bool not null,
TELEPHONE int not null,
NBRE_LIT int not null,
primary key (NUM_CHAMBRE)
);
/*==============================================================*/
/* Table : CLASSES */
/*==============================================================*/
create table CLASSES
(
CODE_CLASSE bool not null,
NBRE_ETOILE int not null,
primary key (CODE_CLASSE)
);
/*==============================================================*/
/* Table : CLIENTS */
/*==============================================================*/
create table CLIENTS
(
CODE_CLIENT char(10) not null,
NOM char(10) not null,
PRENOM char(10) not null,
ADRESSE char(10) not null,
VILLE char(10) not null,
PAYS char(10) not null,
TELEPHONE int not null,
AMAIL char(10) not null,
primary key (CODE_CLIENT)
);
/*==============================================================*/
/* Table : CONSOMMATIONS */
/*==============================================================*/
create table CONSOMMATIONS
(
NUM_CONSO int not null,
CODE_CLIENT char(10) not null,
DATE_CONSOMMATION_ date not null,
HEURE_CONSOMMATION time not null,
primary key (NUM_CONSO)
);
/*==============================================================*/
/* Table : HOTELS */
/*==============================================================*/
create table HOTELS
(
NUM_HOTEL longtext not null,
CODE_CLASSE bool not null,
ADRESSE_HOTEL longtext not null,
TELEPHONE int not null,
BP longtext not null,
SITE_WEB longtext not null,
primary key (NUM_HOTEL)
);
/*==============================================================*/
/* Table : OFFRIR */
/*==============================================================*/
create table OFFRIR
(
NUM_HOTEL longtext not null,
CODE_PRESTATION bool not null,
primary key (NUM_HOTEL, CODE_PRESTATION)
);
/*==============================================================*/
/* Table : PRESTATIONS */
/*==============================================================*/
create table PRESTATIONS
(
CODE_PRESTATION bool not null,
DESIGNATION longtext not null,
primary key (CODE_PRESTATION)
);
/*==============================================================*/
/* Table : RESERVATION */
/*==============================================================*/
create table RESERVATION
(
NUM_RESERVATIONS int not null,
CODE_CLIENT char(10) not null,
NUM_CHAMBRE int not null,
DATE_DEBUT date not null,
DATE_FIN date not null,
MONTANT_PAYER bool not null,
primary key (NUM_RESERVATIONS)
);
/*==============================================================*/
/* Table : SERVIR */
/*==============================================================*/
create table SERVIR
(
CODE_PRESTATION bool not null,
NUM_CONSO int not null,
primary key (CODE_PRESTATION, NUM_CONSO)
);
/*==============================================================*/
/* Table : TARIFER */
/*==============================================================*/
create table TARIFER
(
CODE_CATEGORIE bool not null,
CODE_CLASSE bool not null,
primary key (CODE_CATEGORIE, CODE_CLASSE)
);