- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
oracle外键约束三种删除行为(Oracle foreign key constraint three deletion behavior)
oracle外键约束三种删除行为(Oracle foreign key constraint three deletion behavior)
Oracle foreign key constraint three deletion behavior
Personal classification: SQL
Oracle uses foreign keys to restrict the field values referenced in a child table, requiring data in child tables to exist in the master table. When the primary tables record changes, causing the foreign key reference unique constraint value to change, Oracle specifies three actions: default values (similar to restrict), delete cascade, and delete set null.
Actually experience their different effects on delete operations.
1. create master tables and child tables and initialize several data simply
1) create the master table t_parent and initialize the three record
Sec@ora10g, create, table, t_parent (parent_id, int, primary, key, name, VARCHAR2 (10));
Sec@ora10g, insert, into, t_parent, values (1,record1);
Sec@ora10g, insert, into, t_parent, values (2,record2);
Sec@ora10g, insert, into, t_parent, values (3,record3);
Sec@ora10g commit;
2) create three types of child tables -- t_child1, t_child2, and t_child3
(1) no action type
Sec@ora10g, create, table, t_child1 (child1_id, int, primary, key, parent_id, int);
Sec@ora10g, alter, table, t_child1, add, constraint, FK_t_child1, foreign, key (parent_id), references, t_parent (parent_id);
Sec@ora10g, insert, into, t_child1, values (1,1);
Sec@ora10g commit;
(1) cascade type
Sec@ora10g, create, table, t_child2 (child2_id, int, primary, key, parent_id, int);
Sec@ora10g, alter, table, t_child2, add, constraint, FK_t_child2, foreign, key (parent_id), references, t_parent (parent_id), on, delete,, cascade;
Sec@ora10g, insert, into, t_child2, values (2,2);
Sec@ora10g commit;
(1) set null type
Sec@ora10g, create, table, t_child3 (child2_id, int, primary, key, parent_id, int);
Sec@ora10g, alter, table, t_child3, add, constraint, foreign, FK_t_child3, key (parent_id), references, t_parent (parent_id), on, delete, set,, null;
Sec@ora10g, insert, into, t_child3, values (3,3);
Sec@ora
您可能关注的文档
- 手机bga元件的维修技术与操作技能(上)(Maintenance technology and operation skills of mobile phone BGA components (Part I)).doc
- 抚顺市采煤沉陷区管理规定(Provisions of Fushun Municipality on the administration of coal mining subsidence areas).doc
- 拉萨市城市地下管线管理暂行办法(Interim Measures for the administration of urban underground pipelines in Lhasa).doc
- 拍牌攻略(Brand introduction).doc
- 拒绝批假条 管理车间主管被泼硫酸(Refuse to fake management supervisor was splashed sulfuric acid).doc
- 拓维思资料(Invensys extension data).doc
- 拍摄十八忌(Shooting eighteen bogey).doc
- 招商基础知识(Basic knowledge of investment).doc
- 招投标临时信息(Temporary information of bidding).doc
- 招商局董事长秦晓应将国有资产分散到民众手中(China Merchants board chairman Qin Xiao state-owned assets should be dispersed into the hands of the masses).doc
- oracle创建逻辑standby数据库(Oracle creates a logical standby database).doc
- oracle创建和删除约束(Oracle creates and deletes constraints).doc
- oracle数据库中的模式(Patterns in the Oracle Database).doc
- ora的导入与导出(Import and export of ora).doc
- osd(OSD).doc
- part-00000(part - 00000).doc
- parkingsys(parkingsys).doc
- osi模型各层功能(Each layer function of OSI model).doc
- part-synchronisation gstreamer 同步(- gstreamer 同步 synchronization).doc
- pathloss.v5.0 1cd(为频率在 30 mhz to 100 ghz之间的无线电通讯的通道设计工具)(路径损耗。5.0 1cd(为频率在30 MHz到100 GHz的之间的无线电通讯的通道设计工具)).doc
最近下载
- 道德与法治六年级上册第四单元 法律保护我们健康成长 大单元整体学历案教案 教学设计附作业设计(基于新课标教学评一致性).docx VIP
- 论实验动物的质量管理与控制.docx VIP
- (2024秋新版)北师大版一年级数学上册《可爱的校园》PPT课件.pptx VIP
- 《批判与创意思考》 教材配套PPT 第三章 是什么阻碍了你的思考.pptx VIP
- 麻疹病例教育课件.pptx VIP
- 第九章 冷热疗法课件.ppt VIP
- 2025年秋季新教材部编版小学道德与法治二年级上册全册道法最新教案(教学设计).docx
- 《旅游地理学》全套教学课件.ppt
- 汇德大厦材料二次转运方案.pdf VIP
- 城市公共空间设计教学提纲.ppt VIP
文档评论(0)