0% found this document useful (0 votes)
4 views6 pages

Information - Practices Class 12 Codes

The document provides a series of MySQL queries for managing a school database, including creating a database and table, inserting data, sorting names, and calculating student counts based on gender and subject. It also includes instructions for modifying table structures, joining tables, and retrieving specific student details based on scores. Additionally, there are queries for updating and deleting student records, as well as renaming columns and tables.

Uploaded by

shubhamwagh2007s
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)
4 views6 pages

Information - Practices Class 12 Codes

The document provides a series of MySQL queries for managing a school database, including creating a database and table, inserting data, sorting names, and calculating student counts based on gender and subject. It also includes instructions for modifying table structures, joining tables, and retrieving specific student details based on scores. Additionally, there are queries for updating and deleting student records, as well as renaming columns and tables.

Uploaded by

shubhamwagh2007s
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/ 6

MySQL

1. Write a query to create a new database (name: school)


and a new table (name: student) with appropriate columns

2. Write a query to insert data in student table

Sample output:
3. Write a query to get names in ascending order

4. Write a query to get full name of students

5. Write a query to get count of students on the basis


of gender as well as subject

6. Write a query to add a new column as “Name” and


update data on the basis of ‘First_Name’ & ‘Last_Name’
Sample output:

7. Write a query to drop First_name as well as Last_name

Sample
output

8. Write queries to create, insert & join a new table


(name: grade) with student table
Sample
output

Join
Query

9. Write a query to get average marks of each subject

10. Write a query to add a new column (name: score) in


student table & update data on the basis of grade table
Sample output:

11. Write a query to add a new column (name: fees) in


student table & update data (IP: 2794 & Hindi: 2662)

Sample
output

12. Write a query to get those student details whose


score is 80 or above 80 in order of higher to lower
13. Write a query to delete those students detail whose
score is 75 or below 75

Sample Ouput:

14. Write a query to change column name Gender to sex

15. Write a query to change table name student to xii_c

Sample Ouput:

You might also like