SQL Assignment 3 - Uchiha3000/LINUX_docx GitHub Wiki

SQL ASSIGNMENT PART-3

1. Display the average salary for each department.

code:

2. Find the maximum and minimum salary in each job title.

code:

3. Display the number of employees working in each department.

code:

4. Show the total salary expense for each manager.

code:

5. List the average commission percentage of employees grouped by job_id.

code:

6. Display departments having more than 5 employees using HAVING.

code:

7. Find the total number of employees hired in each year

code:

8. Show the department name and the total salary of employees whose total salary is above 50,000.

code:

9. Find the average salary by job_id, but display only those jobs where the average salary is above 10,000.

code:

10. Display each manager’s ID and the count of employees reporting to them.

code:

11. List departments where the maximum salary exceeds 12,000.

code:

12. Display the job_id having an average salary less than 7,000.

code:

13. Find departments having more than one distinct job_id.

code:

14. Show job titles where the total salary paid is more than 1,00,000.

code:

15. Display locations having more than 2 departments

code:

16. Display the details of employees who earn more than the average salary of their department.

code:

17. Find employees whose salary is greater than the average salary of all employees.

code:

18. Display the department id and average salary of those departments where the average salary is greater than the company-wide average.

code:

19. List the employees who have the highest salary in their respective departments.

code:

20. Display the employees whose salary is less than the minimum salary of department 90.

code: