Practical On SQL Class 12
Practical On SQL Class 12
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
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