📜  CREATE MULTIPLE FK - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:08.429000             🧑  作者: Mango

代码示例1
/* RENAME FK's FOR BETTER :) */
/* Name it fk_food */

  CONSTRAINT `fk_food`
    FOREIGN KEY (`food` )
    REFERENCES `mydb`.`food` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  /* Name it fk_restaurant */
  
  CONSTRAINT `fk_restaurant`
    FOREIGN KEY (`restaurant` )
    REFERENCES `mydb`.`restaurants` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION
    
    );