OCP-1Z0-052-V8 02-10题

               

10. Examine the following statement that is used to modify the constraint on the SALES table:

SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE;

Which three statements are true regarding the above command? (Choose three.)

A.The constraint remains valid.

B.The index on the constraint is dropped.

C.It allows the loading of data into the table using SQL *Loader.

D.New data conforms to the constraint, but existing data is not checked

E.It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.

Answer: ABC

答案解析:

参考:http://blog.csdn.net/rlhua/article/details/12251961

这道题,可用排除法来做,D:属于ENABLE NOVALIDATE,E,不能对已存在的数据做update

所以,只能选择ABC

 

简单来讲,DISABLE 和ENABLE 是针对新增的数据是否符合约束,NOVALIDATE 和VALIDATE是针对已经存在的数据是否符合约束。

题中是DISABLE VALIDATE即是针对新增的数据可以不符合约束,但是已经存在的数据要满足约束。

可以使用排除法,D是属于.ENABLENOVALIDATE

E,不能修改已经存在数据,错误。

C正确,是因为对新增的数据不限制,没有约束。

A正确,是因为DISABLE VALIDATE对现有的数据还有约束。

B呢?

约束条件状态

为了更好地处理数据可能暂时违反约束条件的情况,可将约束条件指定为不同的状态。可以启用(ENABLE) 或禁用(DISABLE) 完整性约束条件。
如果启用约束条件,在数据库中输入或更新数据时就会检查数据。此时,禁止输入不符合约束条件规则的数据。
如果禁用约束条件,则可以在数据库中输入不符合规则的数据。
完整性约束条件可处于以下一种状态:
• DISABLE NOVALIDATE
• DISABLE VALIDATE
• ENABLE NOVALIDATE
• ENABLE VALIDATE
DISABLE NOVALIDATE:不检查新数据和现有数据,因此这些数据可能不符合约束条件。
当数据来自验证过的源,而且表是只读表时,通常会使用此状态。因此,不会将新数据输入表中。在已清理了数据的数据仓库环境中使用NOVALIDATE。此时不需要进行验证,因而可以节省很多时间。
DISABLE VALIDATE:如果约束条件处于此状态, 则不允许对有约束条件的列进行任何修改。因为如果在验证现有数据后,又允许将未经检查的数据输入表中,就会出现不一致的情况。通常,在必须验证现有数据但不进行修改时,以及不需要索引来提高性能时,可使用此状态。
ENABLE NOVALIDATE:新数据符合约束条件,但现有数据处于未知状态。通常在确信表中只存在纯净数据和符合规则的数据的情况下使用该状态,此时不需要进行验证。但是,不允许将违反规则的新数据输入到系统中。
ENABLE VALIDATE:新数据与现有数据均符合约束条件。这是约束条件的典型状态和默认状态。

You can specify that a constraint is enabled (ENABLE) or disabled (DISABLE). If a constraint is enabled, data is checked as it is entered or updated in the database, and data that does not conform to the constraint is prevented from being entered. If a constraint is disabled, then data that does not conform can be allowed to enter the database.

Additionally, you can specify that existing data in the table must conform to the constraint (VALIDATE). Conversely, if you specifyNOVALIDATE, you are not ensured that existing data conforms.

An integrity constraint defined on a table can be in one of the following states:

  • ENABLE, VALIDATE

  • ENABLE, NOVALIDATE

  • DISABLE, VALIDATE

  • DISABLE, NOVALIDATE

           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值