tony-974 Humble motard, c'est rare | Edit : bas du post
   Re,
   Merci.
   Ok pour les identifiants.
 Ok pour le Décimal=Monétaire.
   Voici ce que j'entre (via MySQL en graphique) :
  
  Spoiler :
 
 
 CREATE SCHEMA IF NOT EXISTS `test` ;
   CREATE  TABLE IF NOT EXISTS `test`.`MAGASIN` (
     `magasin_id` INT NOT NULL ,
     `magasin_name` VARCHAR(45) NULL ,
     `magasin_city` VARCHAR(45) NULL ,
     PRIMARY KEY (`magasin_id`) ,
     INDEX `index2` (`magasin_id` ASC) );
   CREATE  TABLE IF NOT EXISTS `test`.`BONBON` (
     `bonbon_type` VARCHAR(4) NOT NULL ,
     `bonbon_libele` VARCHAR(45) NULL ,
     PRIMARY KEY (`bonbon_type`) ,
     INDEX `index2` (`bonbon_type` ASC) );
   CREATE  TABLE IF NOT EXISTS `test`.`PRIX` (
     `magasin_id` INT NOT NULL ,
     `bonbon_type` VARCHAR(4) NOT NULL ,
     `prix` DECIMAL(2) NULL ,
     PRIMARY KEY (`magasin_id`, `bonbon_type`) ,
     INDEX `fk_bonbon` (`bonbon_type` ASC) ,
     INDEX `fk_magasin` () ,
     CONSTRAINT `fk_bonbon`
       FOREIGN KEY (`bonbon_type` )
       REFERENCES `test`.`bonbon` (`bonbon_type` )
       ON DELETE NO ACTION
       ON UPDATE NO ACTION,
     CONSTRAINT `fk_magasin`
       FOREIGN KEY (`magasin_id` )
       REFERENCES `test`.`magasin` (`magasin_id` )
       ON DELETE NO ACTION
       ON UPDATE NO ACTION);
 [/code]
   Pour décimal je me suis trompé je crois qu'il faut mettre quelque chose comme (10,2)
   Et voici le message d'erreur :
   [code=sql]
 ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ,
         CONSTRAINT `fk_bonbon`
           FOREIGN KEY (`bonbon_type` )
           REFERENCES ' at line 13
   SQL Statement:
   CREATE  TABLE IF NOT EXISTS `test`.`PRIX` (
         `magasin_id` INT NOT NULL ,
         `bonbon_type` VARCHAR(4) NOT NULL ,
         `prix` DECIMAL(2) NULL ,
         PRIMARY KEY (`magasin_id`, `bonbon_type`) ,
         INDEX `fk_bonbon` (`bonbon_type` ASC) ,
         INDEX `fk_magasin` () ,
         CONSTRAINT `fk_bonbon`
           FOREIGN KEY (`bonbon_type` )
           REFERENCES `test`.`bonbon` (`bonbon_type` )
           ON DELETE NO ACTION
           ON UPDATE NO ACTION,
   |  
 
       En fait j'ai entré le fk_magasin à la main car en graphique c'était impossible...
   Thanks
   Edit : J'avais un soucis au niveau du fk qui était vide. Ce problème est corrigé depuis. Du moins ça fonctionne à la main mais pas en graphique, le tout c'est que ça fonctionne.
     Message édité par tony-974 le 22-04-2010 à 13:23:40  ---------------
			 ¤ JOE BAR TEAM ¤
    |