0% found this document useful (0 votes)
10 views2 pages

Assignment-3 (Assignments)

The document provides 25 SQL queries related to aggregate functions such as COUNT, AVG, SUM, MAX, MIN and the use of GROUP BY and HAVING clauses. The queries involve operations on date functions, aggregates, and grouping on tables with faculty data.

Uploaded by

Jayita Ghorai
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)
10 views2 pages

Assignment-3 (Assignments)

The document provides 25 SQL queries related to aggregate functions such as COUNT, AVG, SUM, MAX, MIN and the use of GROUP BY and HAVING clauses. The queries involve operations on date functions, aggregates, and grouping on tables with faculty data.

Uploaded by

Jayita Ghorai
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

Assignment-3

(week#5)

(Explain Aggregate functions such as COUNT, AVG, SUM, MAX and MIN also explain use
of Group by with having clause)

(Queries are based on Date operator/function, Aggregate function and Group By Having clause)

Write SQL statement for the following

1. Insert following records in FACULTY table:


(7007, MILLER, Asso. Professor, 1-MAY-81, 18000, CSE, 600)
(8008, DAVID, Professor, 3-AGU-83, 20000, ECE, 300)

2. List the faculty name and salary increased by 10%.

3. SQL to show all faculties hired on December 17, 1981.

4. Display name & hire date of all faculties of ECE department as below
ENAME DATE_HIRED
----------- -------------------------------
SMITH December, Seventeen 1981
JONES Aril, Second 1982
………….. …………..
DAVID August, Third 1983

5. List the faculties who joined on 1-MAY-81, 3-DEC-81,17-DEC-80, 2-APR-82 in ascending


order of seniority.

6. List the details of the faculties whose Daily Sal is more than Rs.100.

7. List the faculties in the ascending order of Designations of those who joined in the first half
of 1981.

8. List the faculties whose post is same as SMITH.

9. List the faculties who are senior to MILLER

10. List the faculties of department ECE whose salary is greater than the salary of ALLEN.

11. List the details of the faculties who are senior to JONES and junior to SMITH.

12. Find details of the faculties who earn more than average salary of department CSE.

Dr. Jaydev Mishra, Faculty-CSE Department


13. Find the minimum salary among all faculties

14. Find the minimum, maximum and average salaries of all faculties.

15. Find details of the faculty who earn minimum salary.

16. Find details of the employee who earn maximum salary.

17. SQL to count the number of faculties in IT department.

18. SQL to calculate the average salary for each different post category.

19. SQL to display minimum salary for each department.

20. Count the total number of faculties join in the year1981.

21. Count number of distinct job in FACULTY table.

22. Count department wise number of faculty available.

23. Find all departments which have more than 2 faculties.

24. Calculate department wise total salary management has to pay for their faculties.

25. Find the department number where departmental average salary is greater than average
salary of all faculties of the organization.

26. Count post wise number of faculties for each department.

27. Count post wise number of faculties in descending order of each department.

Dr. Jaydev Mishra, Faculty-CSE Department

You might also like