4.2. IMPLEMENTATION DE LA BASE DES DONNEES
4.2.1. MODELE
LOGIQUE DES DONNEES
Tableau 4. 1 tableau
récapitulatif du modèle logique
TABLES
|
ATTRIBUTS
|
Programme
|
Id, Date, #Admin, #client
|
LigneProgramme
|
#Idpro, #Idcl, DateDepart, destination,
HeureDepart
|
Client
|
Id, N° CI, Contact, Sexe
|
Reservation
|
Id, dateReserv, depart, dest, Classe, nbrpass,
#client
|
Place
|
ID, type, #reserv
|
Admin
|
matricule
|
Agent
|
matricule, grade
|
ContratTrans
|
Id, datePaiement, montant, #reserv, #agent,
#client
|
User
|
Id, mail, mdp, nom, prenom, pseudo,
#admin,#agent,#client
|
1.1.1. 4.2.2. REQUETTES DES NOUVELLES TABLES
Tableau 4. 2 Tableau des
requêtes
TABLES
|
ATTRIBUTS
|
Programme
|
CREATE
TABLE PROGRAMME(ID
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT, DATE_PROG
DATETIME, n_ADMIN
INT
NOT NULL, n_CLIENT
INT
NOT NULL, FOREIGN KEY (n_ADMIN) REFERENCES admin(MATRICULE), FOREIGN KEY (n_CLIENT) REFERENCES CLIENT (ID)) ENGINE=INNODB
|
LigneProgramme
|
CREATE
TABLE LIGNEPROGRAMME(ID
INT
NOT NULL, programme
INT
NOT NULL, client
INT
NOT NULL, DATE_DEPART
DATETIME, DEST
CHAR(20), HEURE_DEPART
CHAR(10), FOREIGN KEY(programme) REFERENCES programme(ID), FOREIGN KEY(client) REFERENCES client(ID)) ENGINE=INNODB
|
Client
|
CREATE
TABLE CLIENT(ID
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT, NUM_CARTEID
CHAR(20)
NOT NULL,CONTACT
CHAR(20)
NOT NULL, SEXE
CHAR(1)
NOT NULL)
ENGINE=INNODB
|
Reservation
|
CREATE
TABLE RESERVATION(ID
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT, depart
CHAR (25)
NOT NULL, dest
CHAR (30)
NOT NULL ,SEXE
CHAR(1)
NOT NULL , CLASSE
CHAR (30)
NOT NULL , NOMBRE_PASS
INT
NOT NULL , NOMBRE_ENFANT
INT
NOT NULL , DATE_RESERV
DATETIME
NOT NULL, CLIENT
INT
NOT NULL , FOREIGN KEY (CLIENT) REFERENCES CLIENT(ID)) ENGINE=INNODB
|
Place
|
CREATE
TABLE PLACE(ID
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT, TYPE
CHAR(10)
NOT NULL, RESERV
INT
NOT NULL, FOREIGN KEY(RESERV) REFERENCES reservation(ID)) ENGINE=INNODB
|
Admin
|
CREATE
TABLE ADMIN(MATRICULE
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=INNODB
|
Agent
|
CREATE
TABLE AGENT(MATRICULE
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT, GRADE
CHAR (15)
NOT NULL UNIQUE) ENGINE=INNODB
|
ContratTrans
|
CREATE
TABLE CONTRAT(ID
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT, DATE_PAIE
DATETIME, MONTANT
FLOAT
NOT NULL, NUM_CARTE
CHAR(10)
NOT NULL UNIQUE, RESERV
INT
NOT NULL, n_CLIENT
INT
NOT NULL, n_AGENT
INT
NOT NULL, FOREIGN KEY (n_AGENT) REFERENCES agent(MATRICULE), FOREIGN KEY (RESERV) REFERENCES RESERVATION(ID) , FOREIGN KEY (n_CLIENT) REFERENCES CLIENT (ID)) ENGINE=INNODB
|
User
|
CREATE
TABLE _USER(ID
INT
NOT NULL PRIMARY KEY AUTO_INCREMENT, NOM
CHAR (30)
NOT NULL ,MAIL
CHAR(20)
NOT NULL , PRENOM
CHAR (27)
NOT NULL , MDP
CHAR (50), PSEUDO
CHAR (12)
NOT NULL , admin
INT
NOT NULL, agent
INT
NOT NULL, client
INT
NOT NULL , FOREIGN KEY (admin) REFERENCES admin(MATRICULE), FOREIGN KEY (client) REFERENCES client(ID) , FOREIGN KEY (agent) REFERENCES agent (MATRICULE)) ENGINE=INNODB
|
|
|