Check out example codes for "Examine the two pieces of SQL code below". It will help you in understanding the concepts better.

Code Example 1

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) 

);

Learn ReactJs, React Native from akashmittal.com