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

Practical 6

The document outlines a practical assignment for a Database Management System course focused on nested and correlated queries. It includes specific tasks such as writing SQL queries to find employee salaries based on various conditions and using subqueries to analyze department data. The assignment emphasizes both single row and multiple row subqueries, as well as correlated subqueries to extract relevant information from the database schema.

Uploaded by

20yatripatel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Practical 6

The document outlines a practical assignment for a Database Management System course focused on nested and correlated queries. It includes specific tasks such as writing SQL queries to find employee salaries based on various conditions and using subqueries to analyze department data. The assignment emphasizes both single row and multiple row subqueries, as well as correlated subqueries to extract relevant information from the database schema.

Uploaded by

20yatripatel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Database Management System (2CS505CC23)

Practical No : 6

Aim : 1. Nested query


2. Co-related query

1. Using the schema of Practical – 3, do as directed using single


row subquery:
a) Write a query to find the salary of employees whose salary is
greater than the salary of employee whose id is 100.
b) Write a query to find the employees who all are earning the
highest salary.
c) Write a query to find the departments in which the least salary is
greater than the highest salary in the department of id 60.
2. Do as directed, using multiple row subquery:
a) Write a query to find the employees whose salary is equal to
the salary of at least one employee in department of id 90.
b) Write a query to find the employees whose salary is greater
than at least one employee in department of id 60. (Use ANY)
c) Write a query to find the employees whose salary is less than
the salary of all employees in department of id 30. (Use ALL)
d) Write a query to find the employees whose manager and
department should match with the employee of id 110 or 30.
e) Write a query to get the department name of an employee.
3. Do as directed, using correlated subquery:
a) Write a query to find the highest earning employee in each
department. (Use inline view)
b) Write a query to list the department names which have at least
one employee.
c) Write a query to find the departments which do not have
employees at all.
d) Display third highest salary of all employees.

You might also like