nerdexam
Oracle

1Z0-071 · Question #106

Evaluate the following CREATE TABLE commands: CREATE_TABLE orders (ord_no NUMBER (2) CONSTRAINT ord_pk PRIMARY KEY, ord_date DATE, cust_id NUMBER (4) ); CREATE TABLE ord_items (ord _no NUMBER (2)…

The correct answer is A. SYSDATE cannot be used with the CHECK constraint. See the full explanation below for the reasoning.

Question

Evaluate the following CREATE TABLE commands:

CREATE_TABLE orders (ord_no NUMBER (2) CONSTRAINT ord_pk PRIMARY KEY, ord_date DATE, cust_id NUMBER (4) ); CREATE TABLE ord_items (ord _no NUMBER (2), item_no NUMBER(3), qty NUMBER (3) CHECK (qty BETWEEEN 100 AND 200), expiry_date date CHECK (expiry_date> SYSDATE), CONSTRAINT it_pk PRIMARY KEY (ord_no, item_no), CONSTARAINT ord_fk FOREIGN KEY (ord_no) REFERENCES orders (ord_no) ); The above command fails when executed. What could be the reason?

Options

  • ASYSDATE cannot be used with the CHECK constraint.
  • BThe BETWEEN clause cannot be used for the CHECK constraint.
  • CThe CHECK constraint cannot be placed on columns having the DATE data type.
  • DORD_NO and ITEM_NO cannot be used as a composite primary key because ORD_NO is also

How the community answered

(19 responses)
  • A
    84% (16)
  • B
    5% (1)
  • D
    11% (2)

Community Discussion

No community discussion yet for this question.

Full 1Z0-071 Practice