Example 1 :
createtable cust
(custno varchar2(5) primarykey,
cname varchar2(20) unique,
state varchar2(10),
phone number(10),
constraint st check(statein ('Gujarat','Rajasthan','MP','UP','Maharastra')));
Example 2 :
createtable item
(itemno varchar2(5) primarykey,
itemname varchar2(20) notnull,
itemprice number(8,2),
Qty_hand number(3),
constraint itp check(itemprice>0));
Example 3 :
createtable invoice
(invno number(4) primarykey,
invdate date,
custno varchar2(5) references cust);
Example 4 :
createtable invitem
(invno varchar2(5) references invoice,
Itemno varchar2(5) references item,
qty number(3),);