Lab Manual 10
Lab Manual 10
Lab Manual 10
Create table “Salesman”:
Create table salesmen
( sid varchar2(5) primary key,
sname varchar2(20) not null,
city varchar2(15) not null,
salary number(5,2),
product varchar2(20),
tgttoget number(5,2),
comm number(5,2) );
state varchar2(15),
pincode number(10),
product varchar2(20),
class char (1) );
2. Create cust table which contains cno having pk, cname and occupation where data. Values
inserted for cno must start with the capital letter C and cname should be inupper case.
Create table cust
(cno varchar(20) primary key,
cname varchar(30),
occupation varchar(50));
insert into cust (cno,cname,occupation) values('C601','tooba','manager');
3. Find out the name of all the salesmen having „a‟ as the second letter in their names.
4. List all the information of customers whose state contains null value.
Select * from customerss where state is null;
5. List all the information of customers in descending order according to their name.
Exercise 2
1. Display customer no, name, city and order amount.
Select customerss.cid,
customerss.cname,
customerss.city,
orders.o_amt from customerss inner join orders on customerss.cid=orders.cid;
2. Display salesman details with their order details.
Select salesmen.sid,
salesmen.sname,
salesmen.city,orders.oid,
orders.cid,orders.sid,
orders.o_amtfrom salesmen inner join orders on salesmen.sid=orders.sid;
Exercise 3
Create User 1:
Create User 2:
Create Role 1:
Create Role 2: