Department of Information Technology
Lab Assignment-I
IT 38513: Data Base Management System
Q 1. Create the table describe below:
Table Name: CLIENT_MASTER
Description: Used to store client information
Column Name Data Type Size
CLIENTNO Varchar2 6
NAME Varchar2 20
ADDRESS1 Varchar2 30
ADDRESS2 Varchar2 30
CITY Varchar2 15
PINCODE Number 8
STATE Varchar2 15
BALDUE Number 10,2
Table Name: PRODUCT_MASTER
Description: Used to store product information
Column Name Data Type Size
PRODUCTNO Varchar2 6
DESCRIPTION Varchar2 15
PROFITPERCENT Number 4,2
UNITMEASURE Varchar2 10
QTYONHAND Number 8
REORDERLVL Number 8
SELLPRICE Number 8,2
COSTPRICE Number 8,2
Table Name: SALESMAN_MASTER
Description: Used to store salesman information working for the company
Column Name Data Type Size
SALESMANNO Varchar2 6
SALESMANNAME Varchar2 20
ADDRESS1 Varchar2 30
ADDRESS2 Varchar2 30
CITY Varchar2 20
PINCODE Number 8
STATE Varchar2 20
SALAMT Number 8,2
TGTTOGET Number 6,2
YTDSALES Number 6,2
REMARKS Varchar2 60
Q 2. Insert the following data into their respective tables:
a. Data for CLIENT_MASTER Tables:
Client no. Name City Pincode State Baldue
C00001 Ivan Bayross Mumbai 400054 Maharashtra 15000
C00002 Mamta Madras 780001 Tamil Nadu 0
Muzumdar
C00003 Chhaya Bankar Mumbai 400057 Maharashra 5000
C00004 Ashwini Joshi Bangalore 560001 Karnataka 0
C00005 Hansel Colaco Mumbai 400060 Maharashtra 2000
C00006 Deepak Mangalore 560050 Karnataka 0
Sharma
b. Data for PRODUCT_MASTER tables :
Product Description Profit Unit QtyOn ReorderLvl SellPrice CostPrice
No. Percent Measure Hand
P00001 T-Shirts 5 Piece 200 50 350 250
P0345 Shirts 6 Piece 150 50 500 350
P06734 Cotton Jeans 5 Piece 100 20 600 450
P07865 Jeans 5 Piece 100 20 750 500
P07868 Trousers 2 Piece 150 50 850 550
P07885 Pull Overs 2.5 Piece 80 30 700 450
P07965 Denim 4 Piece 100 40 350 250
Shirts
P07975 Lycra tops 5 Piece 70 30 300 175
P08865 Skirts 5 Piece 75 30 450 300
c. Data for SALESMAN_MASTER tables :
Salesman Name Address1 Address2 City Pincode State
No.
S00001 Aman A/134 Worli Mumbai 400002 Maharashtra
S00002 Omkar 65 Nariman Mumbai 400001 Maharashtra
S00003 Raj P-7 Bandra Mumbai 400032 Maharashtra
S00004 Ashish A/5 Juhu Mumbai 400044 Maharashtra
Salesman No. SalAmt TgtToGet YtdSales Remarks
S00001 3000 100 50 Good
S00002 3000 200 100 Good
S00003 3000 200 100 Good
S00004 3500 200 150 Good
Q 3. Excercise on retrieving records from table
a. Find out name of all clients.
b. Retrieve the entire contents of the Client_master table.
c. Retrieve the list of names, city, and the state of all clients.
d. List the various products available from the Product_Master table.
e. List all the clients who are located in mumbai.
f. Find the names of salesman who have a salary equal to Rs. 3000.
Q 4. Excercise on updating records in a table.
a. Change the city of ClientNo 'C00005' to 'Banglore'.
b. Change the Baldue of ClientNo 'C00001' to Rs. 1000.
c. Change the cost price of 'Trousers' to Rs. 950.00.
d. Change the city of salesman to 'Pune'.
Q 5. Excercise on deleting records on table.
a. Delete all salesman from the Salesman_Master whoes salary are equal to 3500.
b. Delete all products from Product_Master where the quantity on hand is equal to 100.
c. Delete from Client_Master where the column state holds the value 'Tamilnadu'.
Q 6. Excercise on altering the table structure
a. Add a column called 'Telephone' of datatype 'number' and size = '10' to the Client_Master table.
b. Change the size of SellPrice column in Product_Master to 10,2.
Q 7. Excersice on deleting the table structure alongwith the data.
a. Destroy the table Client_Master along with its data.
8. Excercise on renaming the table.
a. Change the name of Salesman_Master table to Sman_Mast.