Mysql Workbench外键选项[Restrict,Cascade,Set Null,No Action],它们做什么? [英] Mysql workbench foreign key options [Restrict, Cascade, Set Null, No Action], what do they do?
本文介绍了Mysql Workbench外键选项[Restrict,Cascade,Set Null,No Action],它们做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在外键选项上进行更新和删除. 每个字段[限制,级联,设置为空,无操作]都有什么作用?
In foreign key options on update and on delete. What does each field [Restrict, Cascade, Set Null, No Action] do?
推荐答案
如果您一个一接:
对于更新和删除:
如果您尝试更新/删除父行:
if you try to update / delete the parent row :
限制:如果有子行,则什么也不能删除
Restrict : Nothing gonna be delete if there is a child row
级联:子行也将被删除/更新
Cascade : the child row will be delete / update too
设置空值:如果删除父级,则子级列将设置为空
Set Null : the child column will be set to null if you delete the parent
无操作:删除/更新将不涉及子行
No action : The child row will not be concern of the delete / update
这篇关于Mysql Workbench外键选项[Restrict,Cascade,Set Null,No Action],它们做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文