Oracle.1Z0-051.175q(14)

时间:2026-01-16

OCP 11g 051题库

NOCYCLE;

SQL>CREATE TABLE ord_items

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

item_no NUMBER(3),

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

expiry_date date CHECK (expiry_date > SYSDATE),

CONSTRAINT it_pk PRIMARY KEY (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? (Choose all that

apply.)

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

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

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

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

Answer: AC

QUESTION 32

Which CREATE TABLE statement is valid?

A. CREATE TABLE ord_details

(ord_no NUMBER(2) PRIMARY KEY,

item_no NUMBER(3) PRIMARY KEY,

ord_date DATE NOT NULL);

B. CREATE TABLE ord_details

(ord_no NUMBER(2) UNIQUE, NOT NULL,

item_no NUMBER(3),

ord_date DATE DEFAULT SYSDATE NOT NULL);

C. CREATE TABLE ord_details

(ord_no NUMBER(2) ,

item_no NUMBER(3),

ord_date DATE DEFAULT NOT NULL,

CONSTRAINT ord_uq UNIQUE (ord_no),

CONSTRAINT ord_pk PRIMARY KEY (ord_no));

D. CREATE TABLE ord_details

(ord_no NUMBER(2),

item_no NUMBER(3),

ord_date DATE DEFAULT SYSDATE NOT NULL,

CONSTRAINT ord_pk PRIMARY KEY (ord_no, item_no));

Answer: D

QUESTION 33

You want to create an ORD_DETAIL table to store details for an order placed having the following

business requirement:

1) The order ID will be unique and cannot have null values.

2) The order date cannot have null values and the default should be the current date.

3) The order amount should not be less than 50.

Oracle.1Z0-051.175q(14).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:4.9 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:19元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219