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

8323514-Class_12_IP_WS10

The document is a worksheet for Class XII Informatics Practices, focusing on SQL queries related to aggregate functions, Group By, Having, and DDL commands. It includes exercises for modifying an Employee relation and querying a TEACHER relation with various tasks, such as displaying information, counting, and calculating salaries. The worksheet aims to enhance students' understanding of database management and SQL syntax.

Uploaded by

amalmubarak22016
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 views

8323514-Class_12_IP_WS10

The document is a worksheet for Class XII Informatics Practices, focusing on SQL queries related to aggregate functions, Group By, Having, and DDL commands. It includes exercises for modifying an Employee relation and querying a TEACHER relation with various tasks, such as displaying information, counting, and calculating salaries. The worksheet aims to enhance students' understanding of database management and SQL syntax.

Uploaded by

amalmubarak22016
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/ 2

INDIAN SCHOOL AL WADI AL KABIR

Worksheet, 2021-22

Class: XII SUB:INFORMATICS PRACTICES Date of Completion:

Worksheet No:10 TOPIC : Aggregate functions, Group By , Having and


DDL commands

1) A relation named Employee is given here, you can see the structure of relation. Solve the following
query based on below given structure of relation.

1.Add one column into employee relation for storing department id of an employee.
2.Write a query to change the data type of department to varchar with size of 20 and it should be
NOT NULL.
3.Write a query to make your ID column as a primary key.
4.Write a query to change the name of ID column to EMP_ID.
5.Write a query to change the relation name to EMP_DATA
6.Write a query to drop Department Id column.
7. Write a query to update the name of employee with ID number 2 to “SHRAVAN KUMAR”.
8. Write a query to delete the information of Production department.
9. Write a query to drop the employee relation.

2) Consider the following relation named TEACHER and answet the questions:

ID NAME DEPARTMENT HIREDATE CATEGORY GENDER SALARY


1 Tanya Hindi 1994-03-17 TGT F 25000
Nanda
2 Saurabh Art 1990-02-12 PRT M 20000
Sharma
3 Nandita English 1980-05-16 PGT F 30000
Arora
4 James English 1989-10-16 TGT M 25000
Jacob
5 Jaspret Hindi 1990-08-01 PRT M 22000
Kaur

1| 0 1 - 0 2 - 2 0 2 2 / P R E P A R E D B Y : K h u s h b u J o s h i | I C T D e p t .
6 Disha Math 1980-03-17 PRT F 21000
Seghal
7 Sonali Math 1980-11-17 TGT F 24500
Mukherjee

1. To display all information about the teacher of PGT category.


2. To list the names of female teachers of Hindi department.
3. To list names, department and date of hiring of all teachers in ascending order of date of
joining.
4. To count the number of teachers in English department.
5. Display the department and hire date of all the female teachers whose salary is more than
25000.
6. Display the list of teachers whose name starts with J.
7. Display the total salary of female teachers from Hindi department.
8. Display the maximum, average, minimum and total salary of teacher department wise.
9. Display the department wise average salay of those department where more than 2 teachers
are working.
10. Display the sum of salary of teacher who have joined after ‘1990-01-01’.
11. SELECT COUNT(*) FROM TEACHER WHERE CATEGORY=’PGT’
12. SELECT AVG(SALARY) FROM TEACHER GROUP BY GENDER.

2| 0 1 - 0 2 - 2 0 2 2 / P R E P A R E D B Y : K h u s h b u J o s h i | I C T D e p t .

You might also like