0% found this document useful (0 votes)
19 views7 pages

Lab Assignment 4 - 7

The document outlines a lab assignment for the Department of Electronics & Communication Engineering at the Indian Institute of Information Technology Bhopal, focusing on Database Management Systems (DBMS). It includes instructions for creating tables for client and product masters, inserting data, and performing various SQL operations such as updates, deletions, and queries involving aggregate functions and joins. Additionally, it specifies tasks for grouping data and subqueries related to sales and product information.

Uploaded by

iiitbdiaries11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views7 pages

Lab Assignment 4 - 7

The document outlines a lab assignment for the Department of Electronics & Communication Engineering at the Indian Institute of Information Technology Bhopal, focusing on Database Management Systems (DBMS). It includes instructions for creating tables for client and product masters, inserting data, and performing various SQL operations such as updates, deletions, and queries involving aggregate functions and joins. Additionally, it specifies tasks for grouping data and subqueries related to sales and product information.

Uploaded by

iiitbdiaries11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Indian Institute of Information Technology Bhopal

Department of Electronics & Communication Engineering


Subject Code: - ECE-224, Subject: - DBMS

Lab Assignment

Create the following tables:


a) Client_master

Column Name Datatype Size


Client_no Varchar2 6
Name Varchar2 20
Address1 Varchar2 30
Address2 Varchar2 30
City Varchar2 15
State Varchar2 15
Pincode Number 6
Bal_due Number 10, 2

b) Product_master

Column Name Datatype Size


Product_no Varchar2
Description Varchar2
Profit_percent number
Unit_measure Varchar2
Qty_on_hand Number
Reorder_number Number
Sell_price Number
Cost_price Number
c) Insert the following data into their respective tables:

Client no Name city pincode state bal_due

0001 Ivan Bombay 400054 Maharashtra 15000


0002 Vandana Madras 780001 Tamilnadu 0
0003 Pramada Bombay 400057 Maharashtra 5000
0004 Basu Bombay 400056 Maharashtra 0
0005 Ravi Delhi 100001 Karnataka 2000
0006 Rukmini Bombay 400050 Maharashtra 0

Data for Product Master:


Product No. Description Profit % Unit Qty Reorder Sell Cost

P00001 1.44floppies 5 piece 100 20 525 500


P03453 Monitors 6 piece 10 3 12000 11200
P06734 Mouse 5 piece 20 5 1050 500
P07865 1.22 floppies 5 piece 100 20 525 500
P07868 Keyboards 2 piece 10 3 3150 3050
P07885 CD Drive 2.5 piece 10 3 5250 5100
P07965 540 HDD 4 piece 10 3 8400 8000
P07975 1.44 Drive 5 piece 10 3 1050 1000
P08865 1.22 Drive 5 piece 2 3 1050 1000
Lab Assignment - 4

Objective: - To implement the concept of Aggregate Function

i. Change the selling price of „1.44 floppy drive to Rs.1150.00


ii. Delete the record with client 0001 from the client master table.
iii. Change the city of client_no‟0005‟ to Bombay.
iv. Change the bal_due of client_no „0001, to 1000.
v. Find the products whose selling price is more than 1500 and also find the new selling price
as original selling price *15.
vi. Find out the clients who stay in a city whose second letter is a.
vii. Find out the name of all clients having „a‟ as the second letter in their names.
viii. List the products in sorted order of their description.
ix. Count the total number of orders
x. Calculate the average price of all the products.
xi. Calculate the minimum price of products.
xii. Determine the maximum and minimum prices. Rename the tittle as max_price‟ and
min_price respectively.
xiii. Count the number of products having price greater than or equal to 1500.

Data for sales_man master table

Salesma Salesma Address City Pin State Salamt Tgt_to_get Ytd Remark
n_no nname cod Sal
e es
500001 Kiran A/14 Bom 400002 Mah 3000 100 50 Good
worli bay
500002 Manish 65,narim Bom 400001 Mah 3000 200 100 Good
an bay
500003 Ravi P-7 Bom 400032 Mah 3000 200 100 Good
Bandra bay
500004 Ashish A/5 Bom 400044 Mah 3500 200 150 Good
Juhu bay
Data for sales order table:

S_orderno S_orderdate Client no Dely Bill yn Salesman no Delay Orderstatus


type date
019001 12-jan-96 0001 F N 50001 20-jan- Ip
96
019002 25-jan-96 0002 P N 50002 27-jan- C
96
016865 18-feb-96 0003 F Y 500003 20-feb- F
96
019003 03-apr-96 0001 F Y 500001 07-apr- F
96
046866 20-may-96 0004 P N 500002 22- C
may-96
010008 24-may-96 0005 F N 500004 26- Ip
may-96

Data for sales_order_details table:

S_order no Product no Qty ordered Qty disp Product_rate


019001 P00001 4 4 525
019001 P07965 2 1 8400
019001 P07885 2 1 5250
019002 P00001 10 0 525
046865 P07868 3 3 3150
046865 P07885 10 10 5250
019003 P00001 4 4 1050
019003 P03453 2 2 1050
046866 P06734 1 1 12000
046866 P07965 1 0 8400
010008 P07975 1 0 1050
010008 P00001 10 5 525
Lab Assignment – 5
Objective: - To implement the concept of Joins

1. Find out the product which has been sold to ‘Ivan Sayross.’
2. Find out the product and their quantities that will have do delivered.
3. Find the product_no and description of moving products.
4. Find out the names of clients who have purchased ‘CD DRIVE’
5. List the product_no and s_order_no of customers haaving qty ordered less than
5from the order details table for the product “1.44 floppies”.
6. Find the products and their quantities for the orders placed by ‘Vandan Saitwal ’
and “Ivan Bayross”.
7. Find the products and their quantities for the orders placed by client_no “C00001”
and “C00002”
8. Find the order No,, Client No and salesman No. where a client has been received
by more than one salesman.
9. Display the s_order_date in the format “dd-mm-yy” e.g. “12- feb-96”
10. Find the date , 15 days after date.
Lab Assignment – 6

Objective: - To implement the concept of grouping of Data.

Q. 1. Print the description and total quantity sold for each product.

Q. 2. Find the value of each product sold.

Q. 3. Calculate the average quantity sold for each client that has a maximum order value

of 15000.

Q. 4. Find out the products which has been sold to Ivan.

Q. 5. Find the names of clients who have ‘CD Drive’.

Q. 6. Find the products and their quantities for the orders placed by ‘Vandana’ and ‘Ivan’.

Q. 7. Select product_no, total qty_ordered for each product.

Q. 8. Select product_no, product description and qty ordered for each product.

Q. 9. Display the order number and day on which clients placed their order.

Q. 10. Display the month and Date when the order must be delivered.
Lab Assignment – 7

Objective: - To implement the concept of SubQueries.

1. Find the product_no and description of non- moving products.

2. Find the customer name, address, city and pincode for the client who has placed

order no “019001”

3. Find the client names who have placed order before the month of May 96.

4. Find out if product “1.44 Drive” is ordered by only client and print the client_no

name to whom it was sold.

5. find the names of client who have placed orders worth Rs.10000 or more.

6. Select the orders placed by ‘Rahul Desai”

7. Select the names of persons who are in Mr. Pradeep’s department and who have

also worked on an inventory control system.

8. Select all the clients and the salesman in the city of Bombay.

9. Select salesman name in “Bombay” who has atleast one client located at“Bombay”

10. Select the product_no, description, qty_on_hand, cost_price of non_moving items in

the product_master table.

You might also like