text: -- MySQL Script generated by MySQL Workbench
  -- Thu Mar 11 21:28:40 2021
  -- Model: New Model    Version: 1.0
  -- MySQL Workbench Forward Engineering
  
  SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
  SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
  SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
  
  -- -----------------------------------------------------
  -- Schema mydb
  -- -----------------------------------------------------
  
  -- -----------------------------------------------------
  -- Schema mydb
  -- -----------------------------------------------------
  CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8 ;
  USE `mydb` ;
  
  -- -----------------------------------------------------
  -- Table `mydb`.`eleve`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`eleve` (
    `idEleve` INT NOT NULL AUTO_INCREMENT,
    `nom` VARCHAR(45) NOT NULL,
    `prenom` VARCHAR(45) NOT NULL,
    `dateNaissance` DATE NOT NULL,
    PRIMARY KEY (`idEleve`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`professseur`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`professseur` (
    `idProf` INT NOT NULL AUTO_INCREMENT,
    `nom` VARCHAR(45) NOT NULL,
    `prenom` VARCHAR(45) NOT NULL,
    PRIMARY KEY (`idProf`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`danse`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`danse` (
    `idDanse` INT NOT NULL AUTO_INCREMENT,
    `nom` VARCHAR(45) NOT NULL,
    `tarif` DECIMAL(45) NOT NULL,
    PRIMARY KEY (`idDanse`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`seance`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`seance` (
    `idSeance` INT NOT NULL AUTO_INCREMENT,
    `dateSeance` DATE NOT NULL,
    `professseur_idProf` INT NOT NULL,
    `danse_idDanse` INT NOT NULL,
    PRIMARY KEY (`idSeance`, `professseur_idProf`, `danse_idDanse`),
    INDEX `fk_seance_professseur1_idx` (`professseur_idProf` ASC) VISIBLE,
    INDEX `fk_seance_danse1_idx` (`danse_idDanse` ASC) VISIBLE,
    CONSTRAINT `fk_seance_professseur1`
      FOREIGN KEY (`professseur_idProf`)
      REFERENCES `mydb`.`professseur` (`idProf`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_seance_danse1`
      FOREIGN KEY (`danse_idDanse`)
      REFERENCES `mydb`.`danse` (`idDanse`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`eleve_has_seance`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`eleve_has_seance` (
    `eleve_idEleve` INT NOT NULL,
    `seance_idSeance` INT NOT NULL,
    PRIMARY KEY (`eleve_idEleve`, `seance_idSeance`),
    INDEX `fk_eleve_has_seance_seance1_idx` (`seance_idSeance` ASC) VISIBLE,
    INDEX `fk_eleve_has_seance_eleve_idx` (`eleve_idEleve` ASC) VISIBLE,
    CONSTRAINT `fk_eleve_has_seance_eleve`
      FOREIGN KEY (`eleve_idEleve`)
      REFERENCES `mydb`.`eleve` (`idEleve`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_eleve_has_seance_seance1`
      FOREIGN KEY (`seance_idSeance`)
      REFERENCES `mydb`.`seance` (`idSeance`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  SET SQL_MODE=@OLD_SQL_MODE;
  SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  