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

Mysql Query Solutions

The document contains a series of 14 MySQL queries related to a STUDENT database. It includes instructions for creating a database and a STUDENT table, inserting student records, displaying specific student information, calculating averages, and modifying or deleting records based on certain criteria. The queries cover various operations such as filtering, sorting, and updating data within the database.

Uploaded by

gaadrish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Mysql Query Solutions

The document contains a series of 14 MySQL queries related to a STUDENT database. It includes instructions for creating a database and a STUDENT table, inserting student records, displaying specific student information, calculating averages, and modifying or deleting records based on certain criteria. The queries cover various operations such as filtering, sorting, and updating data within the database.

Uploaded by

gaadrish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Write the following 14 MYSQL query

Q1. To create a database. (You can give any meaningful name to your database)

Q2. To create STUDENT table with the StudentID, Class, Section, Gender,
Name, DOB and Marks as attributes where the StudentIDis the Primary Key.

Q3. To Insert the details of at least 10 students in the above table.


Q4. To display the entire contents/records of the STUDENT table.

Q5. To display StudentID, Name and Marks of those students who are scoring
marks more than 50.
Q6. To find the average of marks from the STUDENT table

Q7. To find the number of Students who are from section ‘A’

Q8. To display the information of all the Students, whose name starts with
‘AN’ (Example: ANAND, ANGAD,…)
Q9. To display StudentID, Name, DOB of those students who are born between
‘2005-01-01’ and ‘2005-12-31’.

Q10. To display StudentID, Name, DOB, Marks, Email of those male students in
ascending order of their names.
As Email field is not added previously in the Table. So, following commands must
be executed first to include it on the table:

Then using UPDATE command I add the Email value to the respective records like
below:

Then, issued the following command to get the records:


Q11. To display StudentID, Name, DOB, Marks, Email of those male students in
descending order of their marks.
Q12. To display the unique section available in the STUDENT table.

Q13. Write a query to modify the marks of all the Students with 5% more
with existing marks.

Q14. Write query to delete records from STUDENT table for students of
Class XII.

===========

You might also like