码迷,mamicode.com
首页 > 数据库 > 详细

【Oracle 12c】最新CUUG OCP-071考试题库(60题)

时间:2019-03-05 15:42:22      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:sequence   ora   tar   eve   max   command   val   考试题   not   

60、(16-10) choose the best answer:

Evaluate the following SQL commands:

SQL>CREATE SEQUENCE ord_seq

INCREMENT BY 10

START WITH 120

MAXVALUE 9999

NOCYCLE;

SQL>CREATE TABLE ord_items

(ord_no NUMBER(4) DEFAULT ord_seq.NEXTVAL NOT NULL,

item_no NUMBER(3),

qty RIUNBER(3) CHECK (qty BETWEEN 100 AND 200),

expiry_date date CHECK (expiry_date > SYSDATE),

CONSTRAINT it_pk PRIMARY REY (ord_no,item_no),

CONSTRAINT ord_fk FOREIGN KEY(ord_no) REFERENCES orders(ord_no));

The command to create a table fails. Identify the reason for the SQL statement failure.

A) You cannot use SYSDATE in the condition of a CHECK constraint.

B) You cannot use the NEXTVAL sequence value as a DEFAULT value for a column.

C) You cannot use the BETWEEN clause in the condition of a CHECK constraint.

D) You cannot use ORD_NO and ITEM_NO columns as a composite primary key because ORD_NO is also the FOREIGN KEY.

Answer:A

(check 约束中明确要求不能:

参考 CURRVAL, NEXTVAL, LEVEL, 和 ROWNUM 这样的伪列

调用 SYSDATE, UID, USER,和 USERENV 函数

参考其它列值的查询

)

【Oracle 12c】最新CUUG OCP-071考试题库(60题)

标签:sequence   ora   tar   eve   max   command   val   考试题   not   

原文地址:https://blog.51cto.com/13854012/2358321

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!