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

Practical On SQL Class 12

Practical on SQL QUERIES Class 12
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)
7 views

Practical On SQL Class 12

Practical on SQL QUERIES Class 12
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/ 2

Practical on SQL

1. Create the following two tables and show the records followed by the following queries.
Table: Product
p_id productname manufacturer Price Discount
TP01 Talcum Powder LAK 40 NULL
FW05 Face Wash ABC 45 5
BS01 Bath Soap ABC 55 NULL
SH06 Shampoo XYZ 120 10
FW12 Face Wash XYZ 95 NULL

Table: Client
c_id clientname city p_id
01 Cosmetic Shop Delhi TP01
02 Total Health Mumbai FW05
03 Live Life Delhi BS01
04 Pretty Woman Delhi SH06
05 Dreams Delhi FW12

i. Display the product name and price of all the product whose price is in the range
50 to 150.
ii. Display the details of the product whose manufacturer is either ABC or XYZ.
iii. Display the product name, manufacturer and price of all the product that are not
giving any discount.
iv. Add a column name state where in every case the state name will be
‘Maharashtra’.
v. Display the product name and price of all the product whose name starts with ‘h’.
vi. Display the client name, city,p_id and product name for all clients whose city is
‘Delhi’.
vii. Display the table Product after removing the column discount.

2. Create the following table and show the records followed by the following queries.

Table: DegreeCourse

Sno Course Duration Eligibility Qualification Fee


1 MBA 2 Graduate PG 500000
2 B.Tech 4 12 UG 650000
3 B.Pharm 4 12 UG 680000
4 BBA 3 12 UG 430000
5 MSc 2 Graduate PG 280000
6 MCA 2 Graduate PG 300000
7 BSc 3 12 UG 290000
8 M.Com 2 Graduate PG 200000
9 B.Com 3 12 UG 290000
10 Diploma 4 10 UG 350000

i. Display all the courses and fees whose duration is 2 years or more.
ii. Display the courses having the highest and lowest fee with name of the course.
iii. Display all the courses with fees whose eligibility is “Graduate”
iv. Reduce the fees of all the courses by 5000 and display the new table.
v. Display the highest and lowest fee with respect to the different form of eligibility.
vi. Display the different forms of eligibility used in the table uniquely.
vii. Display the course, eligibility and qualification whose fee is between 300000 and
500000.

3. Create the following table and show the records followed by the following queries.

Table: Product

Pcode Pname Company Price Stock Manufacture Warranty


P001 TV BPL 10000 200 2018-01-12 3
P002 TV Sony 12000 150 2017-03-23 4
P003 PC Lenovo 39000 100 2018-04-09 2
P004 PC Compaq 38000 120 2019-06-20 2
P005 Handy Cam Sony 18000 250 2017-03-23 3

i. To show details of all PCs with stock more than 110.


ii. To list the company which gives warranty of more than 2 years
iii. To find stock value of the BPL company where stock value is the sum of the products of
price and stock.
iv. To show number of products from each company.
v. To count the number of PRODUCTS which shall be out of warranty on 20-NOV-2020.
vi. To show the PRODUCT name of the products which are within warranty as on date.
vii. Display the maximum price of the product whose warranty is less than 3 years.

You might also like