OCP11g+12c考试资料群:1015267481 验证码:ocp

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

63、(22-4) choose the best answer:

View the Exhibit and examine the data in the PRODUCTS table.

Which statement would add a column called PRICE, which cannot contain NULL?

A) ALTER TABLE products

ADD price NUMBER(8,2) DEFAULT NOT NULL;

B) ALTER TABLE products

ADD price NUMBER(8,2) DEFAULT CONSTRAINT p_nn NOT NULL;

C) ALTER TABLE products

ADD price NUMBER(8,2) NOT NULL;

D) ALTER TABLE products

ADD price NUMBER(8,2) DEFAULT 0 NOT NULL;

Answer:D

(解析,因为表可能已经有数据,如果新加的列为非空约束,则必须要有一个默认值,否则已经存在的行该列上的值为空,会违反非空约束)

posted @ 2019-03-06 11:08  cnblogs_5359  阅读(237)  评论(0编辑  收藏  举报