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

DBMS Lab5

The document outlines a series of SQL queries aimed at analyzing employee salary data across various departments and job types. It includes tasks such as calculating average salaries, filtering departments based on salary thresholds, and displaying employee information with joins. Additionally, it involves creating tables and inserting data related to employee addresses and job grades.

Uploaded by

risav.prasad
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 views14 pages

DBMS Lab5

The document outlines a series of SQL queries aimed at analyzing employee salary data across various departments and job types. It includes tasks such as calculating average salaries, filtering departments based on salary thresholds, and displaying employee information with joins. Additionally, it involves creating tables and inserting data related to employee addresses and job grades.

Uploaded by

risav.prasad
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

1. Find the average salary of each department.

2. Find the average salary for each jobtype according to each department.

3. Find the department names and their corresponding average salary where the average
salary is greater than 40000.

[Link] the departments where the maximum salary is more than 55000.
5. Find the department names and their average salary where the maximum salary of the
department is higher than 55000.

6. Display the job_types and the total monthly salary for each jobtypes as “PAYROLL”, where
the total payroll according to jobtypes exceeds 100000/month.

7. Display the job_types and the total monthly salary for each jobtypes as “PAYROLL”, where
the total payroll according to jobtypes exceeds 100000/month and jobtype is not engineer.
8. Display the job_types and the total monthly salary for each jobtypes as “PAYROLL”, where
the total payroll according to jobtypes exceeds 60000/month and jobtype is not engineer
and sort the list in ascending order of sum of salary.

9. Display the job_types and the total monthly salary for each jobtypes as “PAYROLL”, where
the total payroll according to jobtypes exceeds 50000/month and jobtype is not engineer
and sort the list in descending order of sum of salary.

10. Find the maximum average salary according to departments.


11. Find the minimum average salary according to jobtypes.

12. Find the employee name and date of joining who are working in delhi.

13. Create the table ‘Emp_Address’ for storing the permanent address of the employees and
insert the values.
14. Display the employee name with their home city and the city they work in.

15. Create the following Job_Grades table.


16. Display the employee names along with their salary and job_grade.

17. Display the employees name along with their manager’s name. (use SELF JOIN)
18. Display emp_id, f_name, d_loc, and hod_id (using natural join).

19. Display the employees f_name, city and state in which they live (using natural join).

20. Display the employees emp_id, f_name, d_loc, hod_id using inner join.
21. Display the employees f_name, city and state in which they live (using inner join).

22. Display the employees f_name, city and state in which they live (using join keyword).
23. Insert the following two rows in the employee table without inserting any value in the
department field.

24. Insert the following two rows into the department table.

25. Display the employees f_name, city and state in which they live after joining employee
and employee_address table using left outer join.
26. Display the employees f_name and their work location after joining employee and
department table using left join.
27. Display the employees f_name and their work location after joining employee and
department table using right join.
28. Display the employees f_name and their work location after joining employee and
department table using full join/full outer join.
29. Find the employees who are working in their home city.

30. Find the job type having the minimum average salary according to jobtypes.

You might also like