ocp考试资料群:569933648 验证码:ocp OCP 12c 19c考试题库解析与资料群:钉钉群号:35277291
全部博文(487)
分类: Oracle
2019-03-06 11:05:43
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
(解析,因为表可能已经有数据,如果新加的列为非空约束,则必须要有一个默认值,否则已经存在的行该列上的值为空,会违反非空约束)