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

S21_72

The document outlines a lab experiment focused on implementing simple SQL queries for single table retrieval. It includes various SQL commands to retrieve client names, product details, and order information from specified tables. The queries demonstrate filtering, sorting, and calculations based on specific conditions.

Uploaded by

motwanikunal63
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)
13 views7 pages

S21_72

The document outlines a lab experiment focused on implementing simple SQL queries for single table retrieval. It includes various SQL commands to retrieve client names, product details, and order information from specified tables. The queries demonstrate filtering, sorting, and calculations based on specific conditions.

Uploaded by

motwanikunal63
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

Database Management Systems Lab Experiment No: - 06

Aim: - Implement Simple SQL Queries like single table retrieval

1) Find out the names of all clients.

Select Name from Client_master;

2) Print the entire client_master table.

Select * from Client_master;

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

Select Name,City from Client_master;

1 TSEC Batch:- S21 Name & Roll No:-Kunal Motwani 72


Database Management Systems Lab Experiment No: - 06
Aim: - Implement Simple SQL Queries like single table retrieval

4) List the various products available from the product_master.

Select product_no,Description from product_master;

5) Find the name of all clients having 'a' as the second letter in their names.

Select Name from Client_master where name like '_a%' ;_

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

Select Name from Client_master where City like '_a%' ;

2 TSEC Batch:- S21 Name & Roll No:-Kunal Motwani 72


Database Management Systems Lab Experiment No: - 06
Aim: - Implement Simple SQL Queries like single table retrieval

7) Find the list of all clients who stay in bombay or city delhi or city madras.

Select name from Client_master where city in('bombay', 'delhi', 'madras');

8) List all the clients who are located in 'Bombay'.

Select name from Client_master where city like ('bombay');

9) Print the list of clients whose bal_due are greater than value 10000

Select name from Client_master where bal_due>10000;

3 TSEC Batch:- S21 Name & Roll No:-Kunal Motwani 72


Database Management Systems Lab Experiment No: - 06
Aim: - Implement Simple SQL Queries like single table retrieval

10) Print the information from sales_order table of order placed in month of january.

Select * from sales_order where S_order_date like ' -01- ';

11) Display order information for client_no 'c00001' and 'c00002' ;

Select S_order_no from Client_master where Client_no in(c00001, c00002);

12) Find the products with description as '1.44 drive' and '1.22 drive' .
Select * from product_master where description in(1.44 drive, '1.22 drive ');

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

Select * from product_master where sell_price > 2000 and sell_price <= 5000;

4 TSEC Batch:- S21 Name & Roll No:-Kunal Motwani 72


Database Management Systems Lab Experiment No: - 06
Aim: - Implement Simple SQL Queries like single table retrieval

14) Find the product whose selling price is more than 1500 and also find the new selling price as original price * 15

select product_no, description, sell_price * 15 from product_master where( sell_price > 1500);

15) Rename the new in the above query as new_price


Select product_no,description,sell_price*15 as new_price from product_master;

16) Find the product whose cost price is less than 1500

select * from product_master where cost_price < 1500;

17) List the product in sorted order of their description

select * from product_master order by description ASC;

5 TSEC Batch:- S21 Name & Roll No:-Kunal Motwani 72


Database Management Systems Lab Experiment No: - 06
Aim: - Implement Simple SQL Queries like single table retrieval

18) Calculate the square root of price of each product.

Select product_no,sqrt(cost_price) from product_master;

19) Divide the cost of product '540 HDD' by /difference between its price and 100.

select cost_price / (cost_price - 100) from product_master where description like '540 HDD';

20) List the names,city,state of clients not in the state of 'Maharashtra' .

select name, city, state from client_master where state not like 'Maharashtra';

6 TSEC Batch:- S21 Name & Roll No:-Kunal Motwani 72


Database Management Systems Lab Experiment No: - 06
Aim: - Implement Simple SQL Queries like single table retrieval

21) List the product_no,description,sell_price of products whose description begin with letter 'M' .

select product_no, description, sell_price from product_master where description like 'M%';

22) List of all orders that were cancelled in month of May.

Select * from sales_order where s_order_date like '____-05-__' and order_status like 'c%';

Conclusion: LO2, LO3 mapped

7 TSEC Batch:- S21 Name & Roll No:-Kunal Motwani 72

You might also like