0% found this document useful (0 votes)
1 views1 page

Lab 6 Tasks

DBMS lab
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)
1 views1 page

Lab 6 Tasks

DBMS lab
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/ 1

DEPARTMENT OF COMPUTER SYSTEMS ENGINEERING

MEHRAN UNIVERSITY OF ENGINEERING & TECHNOLOGY, JAMSHORO


Database Management Systems
Lab Experiments
Note: Write a short description and syntax for the statements used. Specify the DBMS
Software/online resource, which you have used to solve the following queries.

Consider following tables for queries.


EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
DEPT (DEPTNO, DNAME, LOC)

Lab 6: To use Group functions in SQL queries.


1. List out the department numbers that have at least 4 employees.
2. Display the number of employees in each department.
3. Display the manager no and the salary of the lowest-paid employee for that manager.
Exclude anyone whose manager is not known. Exclude any groups where the
minimum salary is less than 1000. Sort the output in descending order of salary.
4. Find the most recently hired employee in each department.
5. List the highest salary paid for each job.
6. Display the department number, number of employees in that dept and the average
salary for all employees in that department. Round the average salary to two decimal
places.
7. Write a query that will display the difference between the highest and lowest salaries.
Label the column DIFFERENCE.
8. Display the number of employees with the same job.
9. Determine the number of managers without listing them. (Hint: Use MGR column)
10. Display the job title and total monthly salary for each job title with a total payroll
exceeding 5000. Exclude salespeople and sort the list by the total monthly salary.

You might also like