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

Sub Queries Exercises

The document outlines 8 exercises for an SQL lab involving group by subqueries and joins. The exercises include writing queries to display employee details by department name or number, employee salaries compared to another employee, employees and their managers including those without managers, employees who work in the same department as an employee with a specific last name, department details including average salary and number of commissioned employees, and department name, manager name and city.

Uploaded by

Neha
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)
49 views1 page

Sub Queries Exercises

The document outlines 8 exercises for an SQL lab involving group by subqueries and joins. The exercises include writing queries to display employee details by department name or number, employee salaries compared to another employee, employees and their managers including those without managers, employees who work in the same department as an employee with a specific last name, department details including average salary and number of commissioned employees, and department name, manager name and city.

Uploaded by

Neha
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/ 1

LAB-4 EXERCISES

Group By Subqueries and Joins Exercises

1) Write a query to display all the employees who are working in department
name ‘Accounts’
2) Write a query in SQL to display the first name, last name, department
number, and department name for each employee.
3) Write a query in SQL to display the first name, last name, department
number and department name, for all employees for departments 80 or 40.
4) Write a query in SQL to display the first and last name and salary for those
employees who earn less than the employee earn whose number is 182.
5) Write a query in SQL to display the first name of all employees and the first
name of their manager including those who does not working under any
manager.
6)  Write a query in SQL to display the first name, last name, and department number
for those employees who works in the same department as the employee who
holds the last name as Taylor.
7) Write a query in SQL to display the name of the department, average salary
and number of employees working in that department who got commission.
8) Write a query in SQL to display the department name, full name (first and last
name) of manager, and their city

You might also like