Class 12 IP SQL Practical Questions | MySQL Worksheet for Class 12

Download Latest and Complete pdf series of CBSE IP Class 12 Practical Program Worksheets with code and output covers all important topics.

Practical Worksheets for Class 12 IP are designed to help students develop logical and analytical capabilities, problem solving skills, and improve their subject knowledge. these worksheets are best study materials for students designed by professionals who have vast experience in subject. Practicing these worksheets will certainly enrich student’s thinking skills, subject level understanding, conceptual knowledge, and academic excellence.

Find out all these worksheets available in in both online and PDF format for Class 12 IP SQL Practical Questions which student can access, download and practice offline and become more competitive. All practical programs

Database Management MySQL Practical Worksheet-1

Practical 1: Create following table using SQL statements.

Client table
Field nameData typeAttributes
Clientnochar(6)Primary key
NameVarchar(20)Not Null
CityVarchar(50)Not Null
PinNumber 
MobileChar(10) 

Practical 2:  Insert and display following data in Client table (made in practical1) using SQL statements.

Client table
ClientnoNameCityPinMobile
C00001Ivan BayrossBombay4000543456212343
C00002Vandana SaitwalMadras7800018976532322
C00003Pramada JagusteBombay4000079090898765
C00004Ravi ShreedharanDelhi1100208727121232
C00005RukmaniKolkata3400032312376543
C00006Pradeep SinghaniaJaipur1301021222132333
C00007Geoge PaulKolkata3400103323211232
C0008D RavichandranBombay4000142212387896

Practical 3: Display the name of those clients whose name contains ‘van’ (refer table ‘Client’ of Practical 2)

Practical 4: List records of all clients who are not from Bombay. (refer table ‘Client’ of Practical 2)

Practical 5: Display Different cities. (Refer table ‘Client’ of Practical 2)

Practical 6: Create a table ‘Club’ with proper Integrity constraints and insert data as given below:

CoachidCoachnameAgeSportDateofappPayGender
1Karan35Karate27/03/1910000M
2Ravina34Karate20/01/2012000F
3Kamal34Squash19/02/2020000M
4Tarun33Basketball01/01/2015000M
5Sumeru36Swimming12/01/207500M
6Anjani36Swimming24/02/208000F
7Shamima37Squash20/02/2022000F
8Soumya30Karate22/02/2011000F

Practical 7: Display information about coaches whose name start with K or pay is at least 1500 or both. (Refer table ‘Club’ of Practical 6)

Practical 8: Write a query to display report showing coachname, pay, age and bonus (15% of pay) for all coaches. (Refer table ‘Club’ of Practical 6)

Practical 9: Display information about all male coaches. (Refer table ‘Club’ of Practical 6)

Practical 10: Write command to display the output as (Refer table ‘Club’ of Practical 6)

Karan
Tarun
Anjani
soumya

Practical 11: Consider the following table Movie and display all movies which fall in the category of Comedy or Action.. (NCERT Textbook)

MovieIDMovieNameCategoryReleaseDateProduction CostBusiness Cost
001Hindi_MovieMusical2018-04-23124500130000
002Tamil_MovieAction2016-05-17112000118000
003English_MovieHorror2017-08-06245000360000
004Bengali_MovieAdventure2017-01-0472000100000
005Telugu_MovieAction100000
006Punjabo_MovieComedy30500

Practical 12: Consider the table Movie of practical 11 and display all movies which have not been released yet. (NCERT Textbook)

Practical 13: Consider the table Movie of Practical 11 and display net profit of each movie showing its ID, Name and Net Profit. (NCERT Textbook)

(Hint: NetProfit = BusinessCost –ProductionCost)

Make sure that the new column name is labeled as NetProfit. Is this column now a part of the MOVIE relation. If no, then what name coined for such columns? What can you say about the profit of a movie which has not yet released? Does your query result show profit as zero?.

Practical 14: Consider the following table ‘Stock’ and display all items which name begins with ‘s’ in descending order of rate

IcodeInameBrandQtyRate
101SoapLux10034
102SaltPatanjali11020
103SugarAnnapurna20056
104CoffeNestle60140
105MaggiNestle9083
106CakeBritannia4010
107BiscuitBritannia1305
108Musturd OilPatanjali75180
109JamKissan2054
110TeaBrook Bond30160

Practical 15: consider the table ‘stock’ of practical 14 and list item name and quantity which rate lies between 50 to 100 rupees.

Download PDF for SQL Worksheet – 1

Database Management MySQL Practical Worksheet-2

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.

IDNameDeptGenderExperienceConsultation
201Jaya ReddyENTF12700
202Sanjay PandeyMedicineM5700
203Rakesh MittalOrthopedicF10600
204ShaliniLakraSkinF4400
205Ajay SinghCardiologyM9550
206ArunBissaMedicineM15800
207GurmeetKhedaOrthopedicM11700
208Malini ShankarENTF7500
209Jubaida HassanMedicineF6500
210Tia jenaNeurologyF2300

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(‘techtipnow 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(‘techtipnow 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.

McodeMnameAgeFeesType
M1Anshuman357000Monthly
M2Aradhya258000Monthly
M3Sushmita4224000Yearly
M4Poorvika2712000Quartly
M5Kritika3014000Yearly
M6Sandesh3215000Monthly

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(‘techtipnow computers’,8,7), ‘o’);

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

IcodeInameBrandQtyRate
101SoapLux10034
102SaltPatanjali11020
103SugarPatanjali20056
104CoffeNestle60140
105MaggiNestle9083
106CakeBritannia2010
107BiscuitBritannia1305
108Musturd OilPatanjali75180
109JamKissan2054
110TeaBrook Bond30160

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):
SELECTMAX(Rate)+ MIN(Rate) from Stock where Brand = ‘Patanjali’;

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

Download PDF for SQL Worksheet – 2

Database Management MySQL Practical Worksheet-3

Practical 1: Study following table ‘Inventory’ and write SQL command to display the name of the costliest car with fuel type ‘Petrol’. (NCERT Textbook)

CardIDCarNamePriceModelYearmanufactureFueltypeDiscount
D001Car1582613.00LXI2017Pertrol0.00
D002Car1673112.00VXI2018Petrol6731.00
B001Car2567031.00Sigmal.22019Petrol6808.00
B002Car2647858.00Deltal.22018Petrol7774.96
E001Car3355205.005 STR STD2017CNG4262.46
E002Car3695914.00CARE2018CNG8350.96
S001Car4514000.00LXI2017Petrol6168.00
S002Car4614000.00VXI2018Petrol7368.00

Practical 2: Write SQL command to calculate the average discount and total discount available on Car4. (Refer table ‘Inventory of Practical 1)[NCERT Textbook]

Practical 3: list the total no of cars having no discount. (Refer table ‘Inventory of Practical 1)[NCERT Textbook]

Practical 4: Write SQL command to find the highest price for each Car. (Refer table ‘Inventory of Practical 1)[NCERT Textbook]

Practical 5: for the given table ‘Inventory’ in practical 1 arrange and display all records in ascending order of year of manufacturing.

Practical 6: Write the output produced by SQL command “SELECT MONTH(“2002/12/24”);”

Practical 7: Write the output produced by SQL command “SELECT ROUND(618.4391,-2);”

Practical 8: Display output of SQL Command “SELECT SUBSTR(“techtipnow computers”, 12);”

Practical 9: Write output of SQL Command “SELECT MONTHNAME(curdate());”

Practical 10: Consider the table Supplier given below and predict the output for given SQL Command:
SELECT AVG(Status) FROM Supplier;

SIDStatus
S110
S230
S3NULL
S440
S530

Practical 11: Consider the following table ‘Library’ and list all books with their date of purchase (DOP) in decreasing order.

NoTitleAuthorTypeDOPQtyprice
1Data StructureDixitDS12/10/20034300
2Computer StudiesFrenchFND11/11/2003275
3Advanced PascalShildtPROG01/12/20034350
4Dbase DummiesPalmerDBMS23/12/20035130
5Mastering C++DixitPROG08/01/20043295
6Guide NetworkFreedNET10/02/20043200
7Mastering FoxproSeigalDBMS17/02/20042135
8DOS GuideNortonOS11/03/20043175
9Basic for beginnerMortonPROG21/04/2004340
10Mastering C ProgramsDixitPROG06/05/20041195

Practical 12: Give the output of SQL Command :  (Refer Library table of Practical 11)
SELECT MOD(Qty/Price) FROM Library WHERE Author = ‘Dixit’;

Practical 13: Consider ‘Library’ table given in Practical 10 and Count and display all books which Rate is greater than equal to 200.

Practical 14: Predict the output for given SQL Command:
SELECT SUBSTR(1473.8, 3,1)

Practical 15: For given table ‘Stock’ Suraj has written following SQL Command to display most expensive Item Brandwise:
SELECT Iname, Brand, MAX(Rate) FROM Stock;

But he is not getting desired output. help him to write correct command.

IcodeInameBrandQtyRate
101SoapLux10034
102SaltPatanjali11020
103SugarAnnapurna20056
104CoffeNestle60140
105MaggiNestle9083
106CakeBritannia4010
107BiscuitBritannia1305
108Musturd OilPatanjali75180
109JamKissan2054
110TeaBrook Bond30160

Download PDF for SQL Worksheet – 3

Database Management MySQL Practical Worksheet-4

Practical 1: Consider the following table ‘Cloth’ and display name of cloth in capital letters purchased in year 2020.

CCodeCNameSizeColourPriceDOP
C001JeansLBlue1230.6711/12/20
C002JeansXLBlue1340.8914/12/20
C003ShirtXLRed870.5024/11/20
C004TrouserLKhaki990.9902/01/21
C005T-ShirtXLWhite552.4508/01/21

Practical 2: for given table ‘Cloth’ of Practical 1, write SQL command to display number of cloths purchased each year.

Practical 3: Write the output of the following SQL command:
SELECT ROUND(288.795,-2);

Practical 4: For table ‘Salesman’ with fieldnames sid, sname, zone, amount, Write SQL command to display all salesman name in descending order.
practical 5: Consider table ‘Items’ and write SQL query to display average qty available for each Brand where average qty is/are more than 50.

IcodeInameBrandQtyRate
101SoapLux10034
102SaltPatanjali11020
103SugarPatanjali20056
104CoffeNestle60140
105MaggiNestle9083
106CakeBritannia2010
107BiscuitBritannia1305
108Musturd OilPatanjali75180
109JamKissan2054
110TeaBrook Bond30160

Practical 6: for given table ‘Items’ of Practical 5, Display minimum rate of item of ‘Patanjali’.

Practical 7: Write SQL command to display name of weekday of your date of birth.

Practical 8: Write SQL command to count number of characters in your school name.

Practical 9: Display the output of following SQL command:
SELECT RIGHT(SUBSTR(‘GATEWAY OF INDIA’,-8,5),2);

Practical 10: Write SQL command to calculate cube of 8.

Practical 11: Write the output of SQL command:
SELECT LENGTH(TRIM(“###techtipnow computers## “)); (# refers to blank space)

Practical 12: for the given table ‘Hospital’ write SQL command to display name all patient admitted in month of May.

PIDPNAMEGENDERADMITDATEDEPTFEES
AP/PT/001Rahil KhanM21/04/2019ENT250
AP/PT/002Jitendal PalM12/05/2019Cardio400
AP/PT/003Suman LakraF19/05/2019Cardio400
AP/PT/004Chandumal JainM24/06/2019Neuro600

Practical 13: For given table ‘Hospital’ in Practical 10, List and count total Male/Female patient.

Practical 14: For given string “techtipnow computer education”, Write SQL command to display the position of “education”.

Practical 15: For given table ‘Order’ display those customer nos that have more than 2 orders.

OnoCnoInoQtyTotal
11110100
22110100
332560
44310200
51210120
65110100
7435100

Download Worksheet for SQL – 4