Professional Documents
Culture Documents
Lab Journal
Student Name
Enrolment No.
Class and Section
Objectives:
Nested Queries
Tools Used:
Submission Date:
Lab Tasks
1. Write a query to display their employee names where deptno in emp table matches deptno in dept
table.
2. Display the details of those who draw the salary greater than the average salary
3. Write a query to display information about employees who earn more than any employee in
dept 10.
4. Display the name, department name, and salary of any employee whose salary and commission
match the salary and commission of any employee located in Dallas.
5. Write a query to display the name, department number, and salary of any employee whose
department number and salary both match the department number and salary of any employee who
earns a commission.
6. Create a query to display the name, hiredate, and salary of any employee who have both the same
salary and commission as Scott.
7. Create a query to display the employees who earn a salary that is higher than the salary of all of the
sales managers (JOB_ID = salesmanager). Sort the results on salary from highest to lowest.
8. Display the details of the employee ID, name, and department ID of those employees who live in
cities whose name begins with D.
9. Write a query to display the enames, sal and mgr of every employee whose mgr is ‘BLAKE’
10. Create a query that displays enames, deptno, and hiredates of all employees hired after employee
MARTIN.
11. Write a query to display the empno, enames and salaries of all employees who earn more than the
average salary in a department with any employee with a in their ename.
12. Write a query to display the enames, sal and mgr of every employee whose mgr is same of
MARTIN and sal is greater than 800.
13. Write a query for table EMP and DEPT to retrieve enames , sal, job, deptno where length of job is
greater than length of loc.
14. Write a query that displays employees whose job title is the same as that of employee 7369 and
whose salary is greater than that of employee 7876.
Procedure/Program:
Result/Output:
Analysis/Conclusion: