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
(解析,因为表可能已经有数据,如果新加的列为非空约束,则必须要有一个默认值,否则已经存在的行该列上的值为空,会违反非空约束)
原文地址:https://blog.51cto.com/13854012/2358855
时间: 2024-11-20 10:23:18