Which CREATE TABLE statement is valid?

Which CREATE TABLE statement is valid?

Which CREATE TABLE statement is valid?

A.
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));

B.
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));

C.
CREATE TABLE ord_details (ord_no NUMBER(2) UNIQUE, NOT NULL, item_no
NUMBER(3), ord_date DATE DEFAULT SYSDATE NOT NULL);

D.
CREATE TABLE ord_details (ord_no NUMBER(2) PRIMARY KEY, item_no NUMBER(3)
PRIMARY KEY, ord_date DATE NOT NULL);



Leave a Reply 1

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


Norro

Norro

Executing the statements gives the following output:

A. SQL Error: ORA-00936: missing expression
B. Table ORD_DETAILS created.
C. SQL Error: ORA-00904: : invalid identifier
D. SQL Error: ORA-02260: table can have only one primary key

So the correct answer is B.