text: -- MySQL Script generated by MySQL Workbench
  -- Wed Apr 22 21:36:45 2020
  -- 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`.`Socket`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Socket` (
    `idSocket` INT NOT NULL,
    `Marque` VARCHAR(45) NOT NULL,
    `Type socket` VARCHAR(45) NOT NULL,
    PRIMARY KEY (`idSocket`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Chassis`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Chassis` (
    `Numero de serie` INT NOT NULL,
    `Marque` VARCHAR(45) NULL,
    `Modele` VARCHAR(45) NULL,
    `Format` VARCHAR(45) NULL,
    `Nombre de ventilateur` INT NULL,
    PRIMARY KEY (`Numero de serie`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Processeur`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Processeur` (
    `Numero de serie` INT NOT NULL,
    `Marque` VARCHAR(45) NULL,
    `Modele` VARCHAR(45) NULL,
    `Socket_idSocket` INT NOT NULL,
    PRIMARY KEY (`Numero de serie`, `Socket_idSocket`),
    INDEX `fk_Processeur_Socket_idx` (`Socket_idSocket` ASC) ,
    CONSTRAINT `fk_Processeur_Socket`
      FOREIGN KEY (`Socket_idSocket`)
      REFERENCES `mydb`.`Socket` (`idSocket`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Carte Mere`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Carte Mere` (
    `Numero de serie` INT NOT NULL,
    `Modele` VARCHAR(45) NULL,
    `Marque` VARCHAR(45) NULL,
    `Format` VARCHAR(45) NULL,
    `Couleur` VARCHAR(45) NULL,
    `Nombre de PIE` INT NULL,
    `Socket_idSocket` INT NOT NULL,
    `Chassis_Numero de serie` INT NOT NULL,
    `Processeur_Numero de serie` INT NOT NULL,
    `Processeur_Socket_idSocket` INT NOT NULL,
    PRIMARY KEY (`Numero de serie`, `Socket_idSocket`, `Chassis_Numero de serie`, `Processeur_Numero de serie`, `Processeur_Socket_idSocket`),
    INDEX `fk_Carte Mere_Socket1_idx` (`Socket_idSocket` ASC) ,
    INDEX `fk_Carte Mere_Chassis1_idx` (`Chassis_Numero de serie` ASC) ,
    INDEX `fk_Carte Mere_Processeur1_idx` (`Processeur_Numero de serie` ASC, `Processeur_Socket_idSocket` ASC) ,
    CONSTRAINT `fk_Carte Mere_Socket1`
      FOREIGN KEY (`Socket_idSocket`)
      REFERENCES `mydb`.`Socket` (`idSocket`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Carte Mere_Chassis1`
      FOREIGN KEY (`Chassis_Numero de serie`)
      REFERENCES `mydb`.`Chassis` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Carte Mere_Processeur1`
      FOREIGN KEY (`Processeur_Numero de serie` , `Processeur_Socket_idSocket`)
      REFERENCES `mydb`.`Processeur` (`Numero de serie` , `Socket_idSocket`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Barette de RAM`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Barette de RAM` (
    `Numero de serie` INT NOT NULL,
    `Marque` VARCHAR(45) NULL,
    `Modele` VARCHAR(45) NULL,
    `Frequence` INT NULL,
    `Norme` VARCHAR(45) NOT NULL,
    PRIMARY KEY (`Numero de serie`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Radiateur`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Radiateur` (
    `Numero de serie` INT NOT NULL,
    `Marque` VARCHAR(45) NULL,
    `Modele` VARCHAR(45) NULL,
    `Water cooling` TINYINT NULL,
    PRIMARY KEY (`Numero de serie`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Carte Graphique`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Carte Graphique` (
    `Numero de serie` INT NOT NULL,
    `Modele` VARCHAR(45) NULL,
    `Marque` VARCHAR(45) NULL,
    PRIMARY KEY (`Numero de serie`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Ventilateur`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Ventilateur` (
    `numeros de serie` INT NOT NULL,
    `Marque` VARCHAR(45) NULL,
    `Modele` VARCHAR(45) NULL,
    `Taille` VARCHAR(45) NULL,
    PRIMARY KEY (`numeros de serie`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Carte Mere_has_Carte Graphique`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Carte Mere_has_Carte Graphique` (
    `Carte Mere_Numero de serie` INT NOT NULL,
    `Carte Graphique_Numero de serie` INT NOT NULL,
    PRIMARY KEY (`Carte Mere_Numero de serie`, `Carte Graphique_Numero de serie`),
    INDEX `fk_Carte Mere_has_Carte Graphique_Carte Graphique1_idx` (`Carte Graphique_Numero de serie` ASC) ,
    INDEX `fk_Carte Mere_has_Carte Graphique_Carte Mere1_idx` (`Carte Mere_Numero de serie` ASC) ,
    CONSTRAINT `fk_Carte Mere_has_Carte Graphique_Carte Mere1`
      FOREIGN KEY (`Carte Mere_Numero de serie`)
      REFERENCES `mydb`.`Carte Mere` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Carte Mere_has_Carte Graphique_Carte Graphique1`
      FOREIGN KEY (`Carte Graphique_Numero de serie`)
      REFERENCES `mydb`.`Carte Graphique` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Carte Mere_has_Barette de RAM`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Carte Mere_has_Barette de RAM` (
    `Carte Mere_Numero de serie` INT NOT NULL,
    `Barette de RAM_Numero de serie` INT NOT NULL,
    PRIMARY KEY (`Carte Mere_Numero de serie`, `Barette de RAM_Numero de serie`),
    INDEX `fk_Carte Mere_has_Barette de RAM_Barette de RAM1_idx` (`Barette de RAM_Numero de serie` ASC) ,
    INDEX `fk_Carte Mere_has_Barette de RAM_Carte Mere1_idx` (`Carte Mere_Numero de serie` ASC) ,
    CONSTRAINT `fk_Carte Mere_has_Barette de RAM_Carte Mere1`
      FOREIGN KEY (`Carte Mere_Numero de serie`)
      REFERENCES `mydb`.`Carte Mere` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Carte Mere_has_Barette de RAM_Barette de RAM1`
      FOREIGN KEY (`Barette de RAM_Numero de serie`)
      REFERENCES `mydb`.`Barette de RAM` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Chassis_has_Ventilateur`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Chassis_has_Ventilateur` (
    `Chassis_Numero de serie` INT NOT NULL,
    `Ventilateur_numeros de serie` INT NOT NULL,
    PRIMARY KEY (`Chassis_Numero de serie`, `Ventilateur_numeros de serie`),
    INDEX `fk_Chassis_has_Ventilateur_Ventilateur1_idx` (`Ventilateur_numeros de serie` ASC) ,
    INDEX `fk_Chassis_has_Ventilateur_Chassis1_idx` (`Chassis_Numero de serie` ASC) ,
    CONSTRAINT `fk_Chassis_has_Ventilateur_Chassis1`
      FOREIGN KEY (`Chassis_Numero de serie`)
      REFERENCES `mydb`.`Chassis` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Chassis_has_Ventilateur_Ventilateur1`
      FOREIGN KEY (`Ventilateur_numeros de serie`)
      REFERENCES `mydb`.`Ventilateur` (`numeros de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Radiateur_has_Socket`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Radiateur_has_Socket` (
    `Radiateur_Numero de serie` INT NOT NULL,
    `Socket_idSocket` INT NOT NULL,
    PRIMARY KEY (`Radiateur_Numero de serie`, `Socket_idSocket`),
    INDEX `fk_Radiateur_has_Socket_Socket1_idx` (`Socket_idSocket` ASC) ,
    INDEX `fk_Radiateur_has_Socket_Radiateur1_idx` (`Radiateur_Numero de serie` ASC) ,
    CONSTRAINT `fk_Radiateur_has_Socket_Radiateur1`
      FOREIGN KEY (`Radiateur_Numero de serie`)
      REFERENCES `mydb`.`Radiateur` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Radiateur_has_Socket_Socket1`
      FOREIGN KEY (`Socket_idSocket`)
      REFERENCES `mydb`.`Socket` (`idSocket`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `mydb`.`Radiateur_has_Processeur`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `mydb`.`Radiateur_has_Processeur` (
    `Radiateur_Numero de serie` INT NOT NULL,
    `Processeur_Numero de serie` INT NOT NULL,
    `Processeur_Socket_idSocket` INT NOT NULL,
    PRIMARY KEY (`Radiateur_Numero de serie`, `Processeur_Numero de serie`, `Processeur_Socket_idSocket`),
    INDEX `fk_Radiateur_has_Processeur_Processeur1_idx` (`Processeur_Numero de serie` ASC, `Processeur_Socket_idSocket` ASC) ,
    INDEX `fk_Radiateur_has_Processeur_Radiateur1_idx` (`Radiateur_Numero de serie` ASC) ,
    CONSTRAINT `fk_Radiateur_has_Processeur_Radiateur1`
      FOREIGN KEY (`Radiateur_Numero de serie`)
      REFERENCES `mydb`.`Radiateur` (`Numero de serie`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Radiateur_has_Processeur_Processeur1`
      FOREIGN KEY (`Processeur_Numero de serie` , `Processeur_Socket_idSocket`)
      REFERENCES `mydb`.`Processeur` (`Numero de serie` , `Socket_idSocket`)
      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;
  