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

XII IP Practical 2023 Sql-Lab-3

This document contains 15 SQL practical exercises involving queries on sample tables 'Doctor', 'CLUB', and 'Stock'. The exercises include queries to display female doctors in certain departments, average consultation charges of experienced doctors, minimum consultation fees of male doctors, member name and fees after discount, highest priced item per brand, and calculations using aggregate functions.

Uploaded by

Ria Shah
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)
165 views

XII IP Practical 2023 Sql-Lab-3

This document contains 15 SQL practical exercises involving queries on sample tables 'Doctor', 'CLUB', and 'Stock'. The exercises include queries to display female doctors in certain departments, average consultation charges of experienced doctors, minimum consultation fees of male doctors, member name and fees after discount, highest priced item per brand, and calculations using aggregate functions.

Uploaded by

Ria Shah
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

Lab Activity 3

Practical 1: Study following table ‘Doctor’ and write SQL command to display female doctor names with
remainder of Consultation and experience of department ENT or Medicine.
ID Name Dept Gender Experience Consultation

201 Jaya Reddy ENT F 12 700

202 Sanjay Pandey Medicine M 5 700

203 Rakesh Mittal Orthopedic F 10 600

204 Shalini Lakra Skin F 4 400

205 Ajay Singh Cardiology M 9 550

206 Arun Bissa Medicine M 15 800

207 Gurmeet Kheda Orthopedic M 11 700

208 Malini Shankar ENT F 7 500

209 Jubaida Hassan Medicine F 6 500

210 Tia jena Neurology F 2 300

Practical 2: Consider table ‘Doctor’ of practical 1 and write SQL command to display the average
consultation charges of all doctors having more than 5 year experience.

Practical 3: Consider table ‘Doctor’ of practical 1 and display minimum consultation charge of male
doctors.

Practical 4: Write SQL command to fetch four characters of doctor name. (refer ‘Doctor’ table of Practical
1)

Practical 5: Display output of query: SELECT mid(‘Zydus computer education’,11,9);

Practical 6: What will be output if you add trim() method in given query of practical 5 as: SELECT
trim(mid(‘Zydus computer education’,11,9));

Practical 7: Study following table ‘CLUB’ and write SQL command to display all member names and fees
after giving 12.5% discount.
Mcode Mname Age Fees Type

M1 Anshuman 35 7000 Monthly

M2 Aradhya 25 8000 Monthly

M3 Sushmita 42 24000 Yearly

M4 Poorvika 27 12000 Quartly

M5 Kritika 30 14000 Yearly

M6 Sandesh 32 15000 Monthly


Practical 8: Modify query of Practical 7 to display fee after discount with rounding off to zero decimal
places.

Practical 9: display member names in capital letters whose age not in between 25 to 30yrs. (refer table
‘Club’ of practical 7)

Practical 10: Write SQL command to display eldest member name with his/her fee from table ‘Club’ of
Practical 7.

Practical 11: Display result of SQL Command: SELECT INSTR(SUBSTR(‘Informatics Practices’,8,7), ‘o’);

Practical 12: Consider the following table ‘Stock’ and display all brands with its total quantities.

Icode Iname Brand Qty Rate

101 Soap Lux 100 34

102 Salt Patanjali 110 20

103 Sugar Patanjali 200 56

104 Coffe Nestle 60 140

105 Maggi Nestle 90 83

106 Cake Britannia 20 10

107 Biscuit Britannia 130 5

108 Musturd Oil Patanjali 75 180

109 Jam Kissan 20 54

110 Tea Brook Bond 30 160

Practical 13: Write SQL command to display item name with its price of those having brandwise highest
price. (Refer table ‘Stock’ of Practical 12)

Practical 14: predict Output of given query (Refer table ‘Stock’ of practical 12):
SELECT MAX(Rate) + MIN(Rate) from Stock where Brand = ‘Patanjali’;

Practical 15: predict Output of given query (Refer table ‘Stock’ of practical 12):
SELECT avg(length(Iname)) from Stock where Iname like ‘S%’ or Qty = 20 ;

You might also like