前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【OCP最新题库解析(052)--题44】USER1.EMP has a referential integrity

【OCP最新题库解析(052)--题44】USER1.EMP has a referential integrity

作者头像
小麦苗DBA宝典
发布2019-09-29 15:04:39
3870
发布2019-09-29 15:04:39
举报

该系列专题为2018年4月OCP-052考题变革后的最新题库。题库为小麦苗解答,若解答有不对之处,可留言,也可联系小麦苗进行修改。

注:OCP-052最新题库完整详细解答版请联系小麦苗私聊。解题不易,请大家尊重原创。

QQ:646634621

QQ群:547200174、618766405

微信号:lhrbestxh

Q

题目

USER1.EMP has a referential integrity constraint defined on EMP.DNO that references USER1.DEPT.DNO.

USER1 executes these commads:

SQL> UPDATE dept SET loc='UK' where dno=1;

1 row updated.

SQL>UPDATE emp SET sal=1000 where eno=100;

1 row updated.

SQL>ALTER TABLE dept DROP(dno);

What will be the outcome and why?

A. It will fail because a referential integrity constraint is defined on USER1.EMP

B. It will execute successfully and drop DEPNT.DNO.

C. It will fail because there is an uncommitted transaction on USER1.DEPT.

D. It will execute successfully and drop the DEPT.DNO and EMP.DNO columns.

E. It will fail because there is an uncommitted transaction on USER1.EMP

A

答案

Answer:A

外键(FOREIGN KEY),引用完整性约束(a referential integrity constraint),指明一个列或者列的组合作为一个外键,并且在相同表或者不同表的主键或者唯一键和外键之间建立一个关系。前提是被引用的外键必须是另外一个表的主键。

SCOTT@OCPLHR1> ALTER TABLE dept DROP(deptno);

ALTER TABLE dept DROP(deptno)

*

ERROR at line 1:

ORA-12992: cannot drop parent key column

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-08-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 DB宝 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • USER1.EMP has a referential integrity constraint defined on EMP.DNO that references USER1.DEPT.DNO.
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档