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呢?
约束条件状态
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