SlideShare a Scribd company logo
1 of 8
Table Loan_Accounts –
AccNo Cust_Name Loan_Amount Installments Int_Rate Start_Date
1 R.K. Gupta 300000 36 12.00 19-07-2009
2 S.P. Sharma 500000 45 10.00 22-03-2008
3 K.P. Jain 300000 36 NULL 08-03-2007
4 M.P. Yadav 800000 60 10.00 06-12-2008
5 S.P. Sinha 200000 36 12.50 03-01-2010
6 P. Sharma 700000 60 12.50 05-06-2008
7 K.S. Dhall 500000 48 NULL 05-03-2008
Write SQL commands for the tasks 1 to 35:
Create Database and use it
1. Create the database LOANS.
2. Use the database LOANS.
Create Table/Insert Into
3. Create the table Loan_Accounts and insert tuples in it.
Simple Select
4. Display the details of all the loans.
5. Display the AccNo, Cust_Name and Load_Amount of all the loans.
Conditional Select using Where Clause
6. Display the details of all the loans with less than 40 installments.
7. Display the AccNo and Loan_Amount of all the loans started before 01-04-2009.
8. Display the Int_Rate of all the loans started after 01-04-2009.
Using NULL
9. Display the details of all the loans whose rate of interest is NULL.
10. Display the details of all the loans whose rate of interest in not NULL.
Using DISTINCT Clause
11. Display the amounts of various loans from the table Loan_Accounts. A loan amount should
appear only once.
12. Display the number of installments of various loans from the table Loan_Accounts. An
installment should appear only once.
Using Logical Operators (NOT, AND, OR)
13. Display the details of all the loans started after 31-12-2008 for which the number of installments
are more than 36.
14. Display the Cust_Name and Loan_Amount for all the loans which do not have number of
installments 36.
15. Display the Cust_Name and Loan_Amount for all the loans for which the loan amont is less than
500000 or int_rate is more than 12.
16. Display the details of all the loans which started in the year 2009.
17. Display the details of all the loans whose Loan_Amount is in the range 400000 o 500000.
18. Display the details of all the loans whose rate of interest is in the range of 11% to 12%.
Using IN Operator
19. Display the Cust_Name and Loan_Amount for all the loans for which the number of installments
are 24, 36 or 48.
Using BETWEEN Operator
20. Display the details of all the loans whose Loan_Amount is in the range 400000 to 500000. (Using
BETWEEN Operator)
21. Display the details of all the loans whose rate of interest is in the range 11% to 12%. (Using
BETWEEN Operator)
Using LIKE Operator
22. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name
ends with ‘Sharma’.
23. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name
ends with ‘a’.
24. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name
contains ‘a’.
25. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name
does not contain ‘P’.
26. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name
contains ‘a’ as the second last character.
Using ORDER BY clause
27. Display the details of all the loans in the ascending order of their Loan_Amount.
28. Display the details of all the loans in the descending order of their Start_Date.
29. Display the details of all the loans in the ascending order of their Loan_Amount and within
Loan_Amount in the descending order of their Start_Date.
Using UPDATE, DELETE, ALTER TABLE
30. Put the interest rate 11.50% for all the loans for which interest rate is NULL.
31. Increase the interest rate by 0.5% for all the laons for which the loan amount is more than
400000.
32. For each loan replace Interest with (Loan_Amount*Int_Rate*Installments) 12*100.
33. Delete the records of all the loans whose Start_Date is before 2007.
34. Delete the records of all the loans of ‘K.P. Jain’.
35. Add another column Category of type CHAR(1) in the Loan table.
Students –
AdmNo Name Class Sec RNo Address Phone
1271 Utkarsh
Madaan
12 C 1 C-32,
Punjabi
Bagh
4356154
1324 Naresh
Sharma
10 A 1 31, Mohan
Nagar
435654
1325 Md. Yusuf 10 A 2 12/21,
Chand
Nagar
145654
1328 Sumedha 10 B 23 59, Moti
Nagar
4135654
1364 Subya
Akhtar
11 B 13 12, Janak
Puri
NULL
1434 Varuna 12 B 21 69, Rohini NULL
1461 David
DSouza
11 B 1 D-34, Model
Town
243554,
98787665
2324 Satinder
Singh
12 C 1 1/2,
Gulmohar
Park
143654
2328 Peter Jones 10 A 18 21/32B,
Vishal
Enclave
24356154
2371 Mohini
Mehta
11 C 12 37, Raja
Garden
435654,
6765787
Sports Table –
AdmNo Game CoachName Grade
1324 Cricket Narendra A
1364 Volley Ball M.P. Singh A
1271 Volley Ball M.P. Singh B
1434 Basket Ball I. Malhotra B
1461 Cricket Narendra B
2328 Basket Ball I. Malhotra A
2371 Basket Ball I. Malhotra A
1271 Basket Ball I. Malhotra A
1434 Cricket Narendra A
2328 Cricket Narendra B
1364 Basket Ball I. Malhotra B
Based on these tables write SQL statements for the following queries:
1. Display the lowest and the highest classes from the table STUDENTS.
2. Display the number of students in each class from the table STUDENTS.
3. Display the number of students in class 10.
4. Display details of the students of Cricket Team.
5. Display the Admission number, name, class, section and roll number of the students whose
grade in Sports table is ‘A’.
6. Display the name and phone number of the students of class 12 who play some game.
7. Display the number of students with each coach.
8. Display the names and phone numbers of the students whose grade is ‘A’ and whose coach is
Narendra.
Items Table –
I_Code Name Category Rate
1001 Masala Dosa South Indian 60
1002 Vada Sambhar South Indian 40
1003 Idli Sambhar South Indian 40
2001 Chowmein Chinese 80
2002 Dimsum Chinese 60
2003 Soup Chinese 50
3001 Pizza Italian 240
3002 Pasta Italian 125
Bills Table –
BillNo Date I_Code Qty
1 2013-04-01 1002 2
1 2013-04-01 3001 1
2 2013-04-01 1001 3
2 2013-04-01 1002 1
2 2013-04-01 2003 2
3 2013-04-02 2002 1
4 2013-04-02 2002 4
4 2013-04-02 2003 2
5 2013-04-03 2003 2
5 2013-04-03 3001 1
5 2013-04-03 3002 3
Based on these tables write SQL statements for the following queries:
1. Display the average rate of a South Indian item.
2. Display the number of items in each category.
3. Display the total quantity sold for each item.
4. Display total quantity of each item sold but don’t display this data for the items whose total
quantity sold is less than 3.
5. Display the details of bill records along with Name of each corresponding item.
6. Display the details of the bill records for which the item is ‘Dosa’.
7. Display the bill records for each Italian item sold.
8. Display the total value of items sold for each bill.
Create Tables on the basis of details given below and fill details into them then based on these tables
write SQL Statements for the following queries:
Vehicle Table –
Field Type Null Key Default
RegNo Char(10) No PRI
RegDate Date YES NULL
Owner Varchar(30) YES NULL
Address Varchar(50) YES NULL
Challan Table –
Field Type Null Key Default
Challan_No Int(11) No PRI 0
Ch_Date Date Yes NULL
RegNo Char(10) YES NULL
Offence Int(3) YES NULL
Offence Table –
Field Type Null Key Default
Offence_Code Int(3) NO PRI 0
Off_desc Varchar(30) YES NULL
Challan_Amt Int(4) Yes NULL
1. Display the dates of first registration and last registration from the table Vehicle.
2. Display the number of challans issued on each date.
3. Display the total number of challans issued for each offence.
4. Display the toal number of vehicles for which the 3rd
and 4th
characters of RegNo are ‘6C’.
5. Display the total value of challans issued for which the Off_Desc is ‘Driving without License’.
6. Display details of the challans issued on ‘2013-04-03’ along with Off_Desc for each challan.
7. Display the RegNo of all vehicles which have been challaned more than once.
8. Display details of each challan alongwith vehicle details, Off_desc, and Challan_Amt.
Empp Table –
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30
Dpmt Table –
Dept DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 25000 7
Based on these tables write SQL statements for the following queries:
1. Display the details of all the employees who work in Sales department.
2. Display the Salary, Zone and Grade of all the employees whose HOD is Nupur.
3. Display the Name and Department Name of all the employees.
4. Display the names of all the employees whose salary is not within the specified range for the
corresponding department.
5. Display the name of the department and the name of the corresponding HOD for all the
departments.
12th information practices mysql practice questions

More Related Content

Viewers also liked

Simple class and object examples in java
Simple class and object examples in javaSimple class and object examples in java
Simple class and object examples in javaHarish Gyanani
 
Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handlingpinkpreet_kaur
 
Difference between switch and ladder if
Difference between switch and ladder ifDifference between switch and ladder if
Difference between switch and ladder ifHarish Gyanani
 
Inline functions in c++
Inline functions in c++Inline functions in c++
Inline functions in c++Harish Gyanani
 
Sql like operator examples
Sql like operator examplesSql like operator examples
Sql like operator examplesHarish Gyanani
 
12th ip CBSE chapter 4 oop in java notes complete
12th ip CBSE  chapter 4 oop in java notes complete12th ip CBSE  chapter 4 oop in java notes complete
12th ip CBSE chapter 4 oop in java notes completeHarish Gyanani
 
Learn How to create pyramids in c
Learn How to create pyramids in cLearn How to create pyramids in c
Learn How to create pyramids in cHarish Gyanani
 
100 images for visual brainstorming
100 images for visual brainstorming100 images for visual brainstorming
100 images for visual brainstormingMarc Heleven
 

Viewers also liked (8)

Simple class and object examples in java
Simple class and object examples in javaSimple class and object examples in java
Simple class and object examples in java
 
Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handling
 
Difference between switch and ladder if
Difference between switch and ladder ifDifference between switch and ladder if
Difference between switch and ladder if
 
Inline functions in c++
Inline functions in c++Inline functions in c++
Inline functions in c++
 
Sql like operator examples
Sql like operator examplesSql like operator examples
Sql like operator examples
 
12th ip CBSE chapter 4 oop in java notes complete
12th ip CBSE  chapter 4 oop in java notes complete12th ip CBSE  chapter 4 oop in java notes complete
12th ip CBSE chapter 4 oop in java notes complete
 
Learn How to create pyramids in c
Learn How to create pyramids in cLearn How to create pyramids in c
Learn How to create pyramids in c
 
100 images for visual brainstorming
100 images for visual brainstorming100 images for visual brainstorming
100 images for visual brainstorming
 

Similar to 12th information practices mysql practice questions

SQL practice questions set
SQL practice questions setSQL practice questions set
SQL practice questions setMohd Tousif
 
Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Mohd Tousif
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3Mohd Tousif
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaMohammad Imam Hossain
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2Mohd Tousif
 
Sql queries questions and answers
Sql queries questions and answersSql queries questions and answers
Sql queries questions and answersMichael Belete
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set Mohd Tousif
 
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docxMASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docxalfredacavx97
 
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docxMASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docxendawalling
 
Grading sheet major assignment 2 grading sheetcompetencyrequirement
Grading sheet major assignment 2 grading sheetcompetencyrequirementGrading sheet major assignment 2 grading sheetcompetencyrequirement
Grading sheet major assignment 2 grading sheetcompetencyrequirementoreo10
 
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docxFinal Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docxcharlottej5
 
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docxFinal Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docxlmelaine
 

Similar to 12th information practices mysql practice questions (20)

Mysqlbyjp
MysqlbyjpMysqlbyjp
Mysqlbyjp
 
SQL practice questions set
SQL practice questions setSQL practice questions set
SQL practice questions set
 
Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2
 
Sql queries questions and answers
Sql queries questions and answersSql queries questions and answers
Sql queries questions and answers
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set
 
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docxMASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
 
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docxMASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
MASTER OF EARLY CHILDHOOD STUDIESCompetency Based LearningCh.docx
 
All questions
All questionsAll questions
All questions
 
Sql Queries
Sql QueriesSql Queries
Sql Queries
 
Case study
Case studyCase study
Case study
 
Excel assignment
Excel assignmentExcel assignment
Excel assignment
 
Excel assignment
Excel assignmentExcel assignment
Excel assignment
 
LCC Asia Pacific_financialmodelling_excelshortcuts1
LCC Asia Pacific_financialmodelling_excelshortcuts1LCC Asia Pacific_financialmodelling_excelshortcuts1
LCC Asia Pacific_financialmodelling_excelshortcuts1
 
Grading sheet major assignment 2 grading sheetcompetencyrequirement
Grading sheet major assignment 2 grading sheetcompetencyrequirementGrading sheet major assignment 2 grading sheetcompetencyrequirement
Grading sheet major assignment 2 grading sheetcompetencyrequirement
 
Sql wksht-5
Sql wksht-5Sql wksht-5
Sql wksht-5
 
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docxFinal Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
 
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docxFinal Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
Final Exam, Introductory Macroeconomics (Econ 2) Winter 2019.docx
 

Recently uploaded

Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

12th information practices mysql practice questions

  • 1. Table Loan_Accounts – AccNo Cust_Name Loan_Amount Installments Int_Rate Start_Date 1 R.K. Gupta 300000 36 12.00 19-07-2009 2 S.P. Sharma 500000 45 10.00 22-03-2008 3 K.P. Jain 300000 36 NULL 08-03-2007 4 M.P. Yadav 800000 60 10.00 06-12-2008 5 S.P. Sinha 200000 36 12.50 03-01-2010 6 P. Sharma 700000 60 12.50 05-06-2008 7 K.S. Dhall 500000 48 NULL 05-03-2008 Write SQL commands for the tasks 1 to 35: Create Database and use it 1. Create the database LOANS. 2. Use the database LOANS. Create Table/Insert Into 3. Create the table Loan_Accounts and insert tuples in it. Simple Select 4. Display the details of all the loans. 5. Display the AccNo, Cust_Name and Load_Amount of all the loans. Conditional Select using Where Clause 6. Display the details of all the loans with less than 40 installments. 7. Display the AccNo and Loan_Amount of all the loans started before 01-04-2009. 8. Display the Int_Rate of all the loans started after 01-04-2009. Using NULL 9. Display the details of all the loans whose rate of interest is NULL. 10. Display the details of all the loans whose rate of interest in not NULL. Using DISTINCT Clause 11. Display the amounts of various loans from the table Loan_Accounts. A loan amount should appear only once. 12. Display the number of installments of various loans from the table Loan_Accounts. An installment should appear only once.
  • 2. Using Logical Operators (NOT, AND, OR) 13. Display the details of all the loans started after 31-12-2008 for which the number of installments are more than 36. 14. Display the Cust_Name and Loan_Amount for all the loans which do not have number of installments 36. 15. Display the Cust_Name and Loan_Amount for all the loans for which the loan amont is less than 500000 or int_rate is more than 12. 16. Display the details of all the loans which started in the year 2009. 17. Display the details of all the loans whose Loan_Amount is in the range 400000 o 500000. 18. Display the details of all the loans whose rate of interest is in the range of 11% to 12%. Using IN Operator 19. Display the Cust_Name and Loan_Amount for all the loans for which the number of installments are 24, 36 or 48. Using BETWEEN Operator 20. Display the details of all the loans whose Loan_Amount is in the range 400000 to 500000. (Using BETWEEN Operator) 21. Display the details of all the loans whose rate of interest is in the range 11% to 12%. (Using BETWEEN Operator) Using LIKE Operator 22. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name ends with ‘Sharma’. 23. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name ends with ‘a’. 24. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name contains ‘a’. 25. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name does not contain ‘P’. 26. Display the AccNo, Cust_Name and Loan_Amount for all the loans for which the Cust_Name contains ‘a’ as the second last character. Using ORDER BY clause 27. Display the details of all the loans in the ascending order of their Loan_Amount. 28. Display the details of all the loans in the descending order of their Start_Date. 29. Display the details of all the loans in the ascending order of their Loan_Amount and within Loan_Amount in the descending order of their Start_Date.
  • 3. Using UPDATE, DELETE, ALTER TABLE 30. Put the interest rate 11.50% for all the loans for which interest rate is NULL. 31. Increase the interest rate by 0.5% for all the laons for which the loan amount is more than 400000. 32. For each loan replace Interest with (Loan_Amount*Int_Rate*Installments) 12*100. 33. Delete the records of all the loans whose Start_Date is before 2007. 34. Delete the records of all the loans of ‘K.P. Jain’. 35. Add another column Category of type CHAR(1) in the Loan table.
  • 4. Students – AdmNo Name Class Sec RNo Address Phone 1271 Utkarsh Madaan 12 C 1 C-32, Punjabi Bagh 4356154 1324 Naresh Sharma 10 A 1 31, Mohan Nagar 435654 1325 Md. Yusuf 10 A 2 12/21, Chand Nagar 145654 1328 Sumedha 10 B 23 59, Moti Nagar 4135654 1364 Subya Akhtar 11 B 13 12, Janak Puri NULL 1434 Varuna 12 B 21 69, Rohini NULL 1461 David DSouza 11 B 1 D-34, Model Town 243554, 98787665 2324 Satinder Singh 12 C 1 1/2, Gulmohar Park 143654 2328 Peter Jones 10 A 18 21/32B, Vishal Enclave 24356154 2371 Mohini Mehta 11 C 12 37, Raja Garden 435654, 6765787 Sports Table – AdmNo Game CoachName Grade 1324 Cricket Narendra A 1364 Volley Ball M.P. Singh A 1271 Volley Ball M.P. Singh B 1434 Basket Ball I. Malhotra B 1461 Cricket Narendra B 2328 Basket Ball I. Malhotra A 2371 Basket Ball I. Malhotra A 1271 Basket Ball I. Malhotra A 1434 Cricket Narendra A 2328 Cricket Narendra B 1364 Basket Ball I. Malhotra B
  • 5. Based on these tables write SQL statements for the following queries: 1. Display the lowest and the highest classes from the table STUDENTS. 2. Display the number of students in each class from the table STUDENTS. 3. Display the number of students in class 10. 4. Display details of the students of Cricket Team. 5. Display the Admission number, name, class, section and roll number of the students whose grade in Sports table is ‘A’. 6. Display the name and phone number of the students of class 12 who play some game. 7. Display the number of students with each coach. 8. Display the names and phone numbers of the students whose grade is ‘A’ and whose coach is Narendra. Items Table – I_Code Name Category Rate 1001 Masala Dosa South Indian 60 1002 Vada Sambhar South Indian 40 1003 Idli Sambhar South Indian 40 2001 Chowmein Chinese 80 2002 Dimsum Chinese 60 2003 Soup Chinese 50 3001 Pizza Italian 240 3002 Pasta Italian 125 Bills Table – BillNo Date I_Code Qty 1 2013-04-01 1002 2 1 2013-04-01 3001 1 2 2013-04-01 1001 3 2 2013-04-01 1002 1 2 2013-04-01 2003 2 3 2013-04-02 2002 1 4 2013-04-02 2002 4 4 2013-04-02 2003 2 5 2013-04-03 2003 2 5 2013-04-03 3001 1 5 2013-04-03 3002 3
  • 6. Based on these tables write SQL statements for the following queries: 1. Display the average rate of a South Indian item. 2. Display the number of items in each category. 3. Display the total quantity sold for each item. 4. Display total quantity of each item sold but don’t display this data for the items whose total quantity sold is less than 3. 5. Display the details of bill records along with Name of each corresponding item. 6. Display the details of the bill records for which the item is ‘Dosa’. 7. Display the bill records for each Italian item sold. 8. Display the total value of items sold for each bill. Create Tables on the basis of details given below and fill details into them then based on these tables write SQL Statements for the following queries: Vehicle Table – Field Type Null Key Default RegNo Char(10) No PRI RegDate Date YES NULL Owner Varchar(30) YES NULL Address Varchar(50) YES NULL Challan Table – Field Type Null Key Default Challan_No Int(11) No PRI 0 Ch_Date Date Yes NULL RegNo Char(10) YES NULL Offence Int(3) YES NULL Offence Table – Field Type Null Key Default Offence_Code Int(3) NO PRI 0 Off_desc Varchar(30) YES NULL Challan_Amt Int(4) Yes NULL
  • 7. 1. Display the dates of first registration and last registration from the table Vehicle. 2. Display the number of challans issued on each date. 3. Display the total number of challans issued for each offence. 4. Display the toal number of vehicles for which the 3rd and 4th characters of RegNo are ‘6C’. 5. Display the total value of challans issued for which the Off_Desc is ‘Driving without License’. 6. Display details of the challans issued on ‘2013-04-03’ along with Off_Desc for each challan. 7. Display the RegNo of all vehicles which have been challaned more than once. 8. Display details of each challan alongwith vehicle details, Off_desc, and Challan_Amt. Empp Table – No Name Salary Zone Age Grade Dept 1 Mukul 30000 West 28 A 10 2 Kritika 35000 Centre 30 A 10 3 Naveen 32000 West 40 20 4 Uday 38000 North 38 C 30 5 Nupur 32000 East 26 20 6 Moksh 37000 South 28 B 10 7 Shelly 36000 North 26 A 30 Dpmt Table – Dept DName MinSal MaxSal HOD 10 Sales 25000 32000 1 20 Finance 30000 50000 5 30 Admin 25000 25000 7 Based on these tables write SQL statements for the following queries: 1. Display the details of all the employees who work in Sales department. 2. Display the Salary, Zone and Grade of all the employees whose HOD is Nupur. 3. Display the Name and Department Name of all the employees. 4. Display the names of all the employees whose salary is not within the specified range for the corresponding department. 5. Display the name of the department and the name of the corresponding HOD for all the departments.