Brian Quinn
0
Q:

Examine the two pieces of SQL code below

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 BETWEEN 100 AND 200),

expiry_date CHECK (expiry_date > SYSDATE),

CONSTRAINT its_pky PRIMARY KEY(ord_no, item_no),

CONSTRAINT ord_fky FOREIGN KEY(ord_no)REFERENCES orders(order_no) 

);
0

New to Communities?

Join the community