0% found this document useful (0 votes)
5 views

Exp3part2

Uploaded by

ISHWAR CHAND
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)
5 views

Exp3part2

Uploaded by

ISHWAR CHAND
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

SELECT columnname,columname

FROM tablename
WHERE searchcondition;

Practical Tasks:

1. Create the following tables:

i) client_master

columnname datatype size


client_no varchar 6
name varchar 20
address1 varchar 30
address2 varchar 30
city varchar 15
state varchar 15
pincode number 6
bal_due number 10,2

ii) Product_master
Columnname datatype size
Product_no varchar 6
Description varchar 20
Profit_percent number 10,2
Unit_measure varchar 10
Qty_on_hand number 10
Reoder_lvl number 10
Sell_price number 10
Cost_price number 10

2- Insert the following data into their respective tables:


Client_no Name city pincode state bal_due

C0001 Ivan Bombay 400054 Maharashtra 15000


C0002 Vandana Madras 780001 Tamilnadu 0
C0003 Pramada Bombay 400057 Maharashtra 5000
C0004 Basu Bombay 400056 Maharashtra 0
C0005 Ravi Delhi 100001 Delhi 2000
C0006 Rukmini Bombay 400050 Maharashtra 0

Data for Product Master:

Product No. Desciption Profit % Unit Qty Reorder Sell Cost


Percent measured on hand lvl price

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

3:- On the basis of above two tables answer the following queries:

i) Find out the names of all the clients.


ii) Retrieve the list of names and cities of all the clients.

iii) List the various products available from the product_master table.

iv) List all the clients who are located in Bombay.


v) Display the information for client no 0001 and 0002.

vi) Find the products with description as ‘1.44 drive’ and ‘1.22 Drive’.

vii) Find all the products whose sell price is greater then 5000.

viii) Find the list of all clients who stay in in city ‘Bombay’ or city ‘Delhi’ or ‘Madras’.

ix) Find the product whose selling price is greater than 2000 and less than or equal to 5000.

x) List the name, city and state of clients not in the state of ‘Maharashtra’.
Practical Tasks:

Using the table product master and client master answer the following questions.

1. Change the selling price of ‘1.44 floppy drive to Rs.1150.00

2. Delete the record with client 0001 from the client master table.

3. Change the city of client_no’0005’ to Bombay.

4. Change the bal_due of client_no ‘0002, to 1000.


5. Find the products whose selling price is more than 1500 and also find the new selling price as
original selling price *15.

6. Find out the clients who stay in a city whose second letter is a.

7. Find out the name of all clients having ‘a’ as the second letter in their names.

8. List the products in sorted order of their description.

9. Count the total number of orders


10. Calculate the average price of all the products.

11. Calculate the minimum price of products.

12. Determine the maximum and minimum prices . Rename the tittle as ‘max_price’ and min_price
respectively.

13. Count the number of products having price greater than or equal to 1500.

You might also like