THE EMIRATES NATIONAL SCHOOL – SHARJAH
INFORMATICS PRACTICES
Grade XII (2025 – ‘26)
CHAPTER 4 – Database Query Using MySQL
Worksheet - 3
Topic – Aggregate Functions / Group By
Consider the database SCHOOL with the following table TEACHER
ID NAME DEPARTMENT HIREDATE CATEGORY GENDER SALARY
1 Tanya Nanda Social Studies 1994-03-17 TGT F 25000
2 Saurabh Sharma Art 1990-02-12 PRT M 20000
3 Nandita Arora English 1980-05-16 PGT F 30000
4 James Jacob English 1989-10-16 TGT M 25000
5 Jaspreet Kaur Hindi 1990-08-01 PRT F 22000
6 Disha Sehgal Math 1980-03-17 PRT F 21000
7 Sonali Mukherjee Math 1980-11-17 TGT F 24500
Write SQL commands for the following:
1. To display all information about the teachers of PGT category.
2. To list the female teachers of Hindi department.
3. To list the name, department and date of hiring of all teachers in the ascending order of
date of joining.
4. To count the number of PGT teachers in English department.
5. To display the department and hire date of all female teachers whose salary is more than
25000
6. To count the different departments in the above table.
7. To find the maximum and minimum salary of a teacher.
8. To find the average salary of a teacher in Math department.
9. To find the total salary of all male teachers.
10. To count the number of male and female teachers.
11. To find the maximum and minimum salary of each department.
12. To calculate the number of teachers in each department.
13. To find the total salary of teachers category wise.
14. To find the total number of teachers.
15. To display the departments having more than two teachers.