DBMS5 1
DBMS5 1
Problem Statement 5.1: Find employees who work in the 'IT' department.
Objective: Retrieve the details of all employees who are working in the 'IT'
department.
Query:
OUTPUT:
OUTPUT:
PAWAN KUMAR MCA-B Roll no -47
OUTPUT:
Problem Statement 5.4: Find employees who joined before the most recent
joining date.
Objective: List the employees who joined the company before the most recent
joining date.
Query:
OUTPUT:
PAWAN KUMAR MCA-B Roll no -47
Problem Statement 5.5: Find employees who do not belong to any department.
Objective: Retrieve the details of employees who are not assigned to any
department.
Query:
OUTPUT:
Problem Statement 5.6: Find the department name of the employee with the
highest salary.
Objective: Find the name of the department where the employee with the
highest salary works.
Query:
OUTPUT:
PAWAN KUMAR MCA-B Roll no -47
Problem Statement 5.7: Find employees who belong to the department with
the highest number of employees.
Objective: Retrieve the employees who belong to the department with the
highest number of employees.
Query:
OUTPUT:
Problem Statement 5.8: Find employees whose salary is higher than any
employee in the HR department.
Objective: Identify employees whose salary is higher than at least one
employee in the HR department.
Query:
OUTPUT:
PAWAN KUMAR MCA-B Roll no -47
Problem Statement 5.9: Find departments where all employees earn above
50,000.
Objective: List the departments where all employees earn more than 50,000.
Query:
OUTPUT:
Problem Statement 5.10: Find employees who earn more than at least one
employee in the IT department.
Objective: Identify employees whose salary is higher than at least one
employee in the IT department.
Query:
OUTPUT:
PAWAN KUMAR MCA-B Roll no -47
OUTPUT:
Problem Statement 5.12: Find employees who joined before any employee in
the Finance department.
Objective: Identify employees who joined before the earliest employee in the
Finance department.
Query:
OUTPUT:
PAWAN KUMAR MCA-B Roll no -47
Problem Statement 5.13: Find employees who earn more than all employees in
the HR department using multi-row sub-queries.
Objective: Find employees who earn more than every employee in the HR
department, using multi-row subqueries.
Query:
OUTPUT: