1 . cascade方式
在父表上update/delete记录时,同步update/delete掉子表的匹配记录 

   2. set null方式
在父表上update/delete记录时,将子表上匹配记录的列设为null
要注意子表的外键列不能为not null  

   3. No action方式
如果子表中有匹配的记录,则不允许对父表对应候选键进行update/delete操作  

   4. Restrict方式
同no action, 都是立即检查外键约束

   5. Set default方式
父表有变更时,子表将外键列设置成一个默认的值 但Innodb不能识别

相关文章:

  • 2022-12-23
  • 2021-05-22
  • 2021-12-30
  • 2022-12-23
  • 2021-09-28
  • 2021-09-02
猜你喜欢
  • 2022-02-28
  • 2022-12-23
  • 2021-08-20
  • 2021-06-08
  • 2021-12-21
  • 2021-10-05
相关资源
相似解决方案