加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-12 13:18:19 所属栏目:百科 来源:网络整理
导读:60、(16-10) choose the best answer: Evaluate the following SQL commands: SQLCREATE SEQUENCE ord_seq INCREMENT BY 10 START WITH 120 MAXVALUE 9999 NOCYCLE; SQLCREATE TABLE ord_items (ord_no NUMBER(4) DEFAULT ord_seq.NEXTVAL NOT NULL, item_no

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 函数

参考其它列值的查询

)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读