Commit 564557d2edce4b32676e05b07b252f7c67f28695

Authored by lwadbled
1 parent 0f174189

add(bdd.sql): Fichier de la base de donnee

Showing 1 changed file with 47 additions and 0 deletions   Show diff stats
bdd.sql 0 → 100644
... ... @@ -0,0 +1,47 @@
  1 +/* Fichier de création des informations de la BDD */
  2 +
  3 +/* Suppression des vues si elles existent */
  4 +
  5 +/* Suppression des tables si elles existent */
  6 +
  7 +drop table if exists utilisateur ;
  8 +drop table if exists creneau ;
  9 +drop table if exists banc ;
  10 +drop table if exists equipement ;
  11 +drop table if exists reservation ;
  12 +
  13 +/* Creation des tables pour l'interface Web */
  14 +
  15 +create table utilisateur
  16 + (LOGIN char(8) PRIMARY KEY,
  17 + MDP char(20));
  18 +
  19 +create table creneau
  20 + (JOUR char(10) PRIMARY KEY);
  21 +
  22 +create table banc
  23 + (NUMERO int PRIMARY KEY);
  24 +
  25 +create table equipement
  26 + (IP char(15) PRIMARY KEY,
  27 + NOM char(50),
  28 + TYPE char(30));
  29 +
  30 +create table reservation
  31 + (reserve int REFERENCES banc,
  32 + moment char(10) REFERENCES creneau,
  33 + personne char(8) REFERENCES utilisateur,
  34 + HEUREDEBUT char(5),
  35 + HEUREFIN char(5),
  36 + UNIQUE(moment,personne),
  37 + PRIMARY KEY(reserve,moment));
  38 +
  39 +/* Insertions des donnees dans la BDD */
  40 +
  41 +insert into utilisateur values ('lwadbled','Louis');
  42 +
  43 +insert into creneau values ('01/12/2021');
  44 +
  45 +insert into banc values (1);
  46 +
  47 +/* Creation des vues pour faciliter l'utilisation de la BDD sur l'interface Web */
... ...