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

View the Exhibit and examine the data in the PRODUCTS table. Which statement would add a column called PRICE, which cannot contain NULL?

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) NOT NULL;

B.
ALTER TABLE products
ADD price NUMBER(8,2) DEFAULT NOT NULL;

C.
ALTER TABLE products
ADD price NUMBER(8,2) DEFAULT 0 NOT NULL;

D.
ALTER TABLE products
ADD price NUMBER(8,2) DEFAULT CONSTRAINT p_nn NOT NULL;



Leave a Reply 4

Your email address will not be published. Required fields are marked *


miriam

miriam

Why is answer not A? Because it already has rows?

R

R

miriam, thank you very much. You answered my question with your question 🙂
A is not correct “Because it already has rows”.

Tomek

Tomek

Yes. Not A because tab already has rows.
ORA-01758: table must be empty to add mandatory (NOT NULL) column