ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-023

047-023

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-16 16:15:07 0 删除 编辑
23. View the Exhibit and examine the structure of the CUST table.
Evaluate the following SQL statements executed in the given order:
ALTER TABLE cust ADD CONSTRAINT cust_id_pk PRIMARY KEY(cust_id) DEFERRABLE
INITIALLY DEFERRED.
INSERT INTO cust VALUES (1,'RAJ'). –row 1
INSERT INTO cust VALUES (1,'SAM'). –row 2
COMMIT.
SET CONSTRAINT cust_id_pk IMMEDIATE.
INSERT INTO cust VALUES (1,'LATA'). –row 3
INSERT INTO cust VALUES (2,'KING'). –row 4
COMMIT.
Which rows would be made permanent in the CUST table?
A. row 4 only
B. rows 2 and 4
C. rows 3 and 4
D. rows 1 and 4
Answer: C
初始化立即执行--在每条语句执行结束时检验约束
初始化延迟执行,一直等到事务完成后(或者调用set constraint immediate语句时)
才检验约束

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11312660/viewspace-718778/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 047-022
下一篇: 047-026
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    204329