SQL> create table customer(cid
int,cname varchar2(20),age int,sex varchar2(10),dob varchar2(20),address
varchar2(20),phno int,email varchar2(20),anualincome varchar2(10),primary
key(cid));
Table created.
SQL>
insert into customer
values('&cid','&cname','&age','&sex','&dob','&address','&phno','&email','
&annualincome');
Enter value for cid: 1
Enter value for cname: john
Enter value for age: 58
Enter value for sex: male
Enter value for dob: 5/7/55
Enter value for address: german
Enter value for phno: 8548547895
Enter value for email: john2@gmail.com
Enter value for annualincome: 15000
1 row created.
SQL> select * from customer;
CID
CNAME AGE SEX
DOB ADDRESS
PHNO EMAIL ANUALINCOME
---------- --------------------
---------- ----------
-------------------- -------------------- ---------- -----------------
1
john 58 male
5/7/55 german 8548547895 john2@gmail.com 15000
2 mac 47 male
1/9/65 japan 854769485 mac33@gmail.com 14000
3 sam 21 male
1/7/91 greek 789456215 sam2@yahoo.com 10000
SQL> create table product(cid int,pid
int,pname varchar2(20),brandname varchar2(20),price int,quantity int,primary
key(cid,pid),foreign key(cid) references
customer);
Table created.
SQL> insert into product
values('&cid','&pid','&pname','&brandname','&price','&quantity');
Enter value for cid: 1
Enter value for pid: 1
Enter value for pname: x220
Enter value for brandname: sony
Enter value for price: 2500
Enter value for quantity: 5
1 row created.
SQL> select * from product;
CID
PID PNAME BRANDNAME PRICE
QUANTITY
------
------ ------------ --------------------- ----------
------------------
1 1 x220 sony 2500 5
2 2 xpro sony 10000 3
3 3 star 3 samsung 7000 1
SQL> create table person(pid
int,pname varchar2(20),address varchar(20),city varchar2(20), unique(pid));
Table created.
SQL> insert into person
values('&pid','&pname','&address','&city');
Enter value for pid: 1
Enter value for pname:john
Enter value for address:7th
north street
Enter value for city:coimbatore
1 row created.
SQL> select * from person;
PID
PNAME ADDRESS CITY
-----
-----------
-------------- -------
1 john 7th north street coimbatore
2 sam 2nd korea street cbe
3 winsester 4th cross street kovai