text: CREATE DATABASE IF NOT EXISTS recrutementTest;
  
  USE recrutementTest;
  
  CREATE TABLE IF NOT EXISTS admin
  (
    ID INT primary key AUTO_INCREMENT,
    NOM VARCHAR(50) NOT NULL ,
    PRENOMS VARCHAR(150) NOT NULL ,
    USERNAME VARCHAR(100) NOT NULL ,
    PASSWORD TEXT NOT NULL
  );
  
  CREATE TABLE IF NOT EXISTS gestionnaire
  (
    ID INT primary key AUTO_INCREMENT,
   NOM VARCHAR(50) NOT NULL ,
   PRENOMS VARCHAR(150) NOT NULL ,
   USERNAME VARCHAR(100) NOT NULL ,
   PASSWORD TEXT NOT NULL,
   ADMIN_ID INT ,
   FOREIGN KEY (ADMIN_ID) REFERENCES ADMIN(ID)
  );
  
  CREATE TABLE IF NOT EXISTS technicien
  (
     ID INT primary key AUTO_INCREMENT,
    NOM VARCHAR(50) NOT NULL ,
    PRENOMS VARCHAR(150) NOT NULL ,
    USERNAME VARCHAR(100) NOT NULL ,
    PASSWORD TEXT NOT NULL,
    ADMIN_ID INT ,
    FOREIGN KEY (ADMIN_ID) REFERENCES ADMIN(ID)
  );
  
  CREATE TABLE IF NOT EXISTS type_vehicule
  (
    ID INT PRIMARY KEY AUTO_INCREMENT,
    TYPE VARCHAR(50) NOT NULL
  );
  
  CREATE TABLE IF NOT EXISTS vehicule
  (
    ID INT PRIMARY KEY AUTO_INCREMENT,
    TYPE_VEHICULE_ID INT,
    DATE_ACHAT DATE,
    GESTIONNAIRE_ID INT,
    FOREIGN KEY (GESTIONNAIRE_ID) REFERENCES GESTIONNAIRE(ID),
    FOREIGN KEY (TYPE_VEHICULE_ID) REFERENCES TYPE_VEHICULE(ID)
  );
  
  CREATE TABLE IF NOT EXISTS probleme
  (
    ID INT PRIMARY KEY AUTO_INCREMENT,
    TECHNICIEN_ID INT,
    VEHICULE_ID INT,
    DETAIL TEXT,
    FOREIGN KEY (TECHNICIEN_ID) REFERENCES TECHNICIEN(ID),
    FOREIGN KEY (VEHICULE_ID) REFERENCES VEHICULE(ID)
  );
  
  CREATE TABLE IF NOT EXISTS maintenance
  (
    ID INT PRIMARY KEY AUTO_INCREMENT,
    DATE_DEBUT DATE,
    DATE_FIN DATE,
    SUJET TEXT,
    DESCRIPTION TEXT,
    PROBLEME_ID INT,
    FOREIGN KEY(PROBLEME_ID) REFERENCES PROBLEME(ID)
  );
  
  CREATE TABLE IF NOT EXISTS intervenir
  (
    ID INT PRIMARY KEY AUTO_INCREMENT,
    TECHNICIEN_ID INT,
    MAINTENANCE_ID INT,
    FOREIGN KEY (TECHNICIEN_ID) REFERENCES TECHNICIEN(ID),
    FOREIGN KEY (MAINTENANCE_ID) REFERENCES MAINTENANCE(ID)
  );
  
  CREATE TABLE IF NOT EXISTS piece
  (
    ID INT PRIMARY KEY AUTO_INCREMENT,
    PIECE TEXT NOT NULL ,
    MAINTENANCE_ID INT,
    FOREIGN KEY (MAINTENANCE_ID) REFERENCES MAINTENANCE(ID)
  );
  
  INSERT INTO admin
  values (NULL, 'ADMIN', 'ADMIN', 'admin', 'f7c3bc1d808e04732adf679965ccc34ca7ae3441');