0% found this document useful (0 votes)
13 views10 pages

LAB_4

The document outlines a series of SQL exercises for a student named Dania Noor, roll number CT-23020. The tasks include completing a section on basic joins, studying self joins, and writing various queries to display employee information based on specific criteria. The exercises focus on retrieving and labeling data related to employees, their managers, and departments.

Uploaded by

noor4601283
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)
13 views10 pages

LAB_4

The document outlines a series of SQL exercises for a student named Dania Noor, roll number CT-23020. The tasks include completing a section on basic joins, studying self joins, and writing various queries to display employee information based on specific criteria. The exercises focus on retrieving and labeling data related to employees, their managers, and departments.

Uploaded by

noor4601283
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/ 10

Name: Dania Noor

Roll no: CT-23020


LAB 4 Exercises:
1. Complete the ‘Basic Joins’ section of SQL 50 Badge on leetcode.
2. Study Self Join and solve the following question:
Display the employee last name and employee id along with their manager’s last
name and manager id. Label the columns as Employee_ID, Emp_LN , Manager_ID,
and Mgr_LN.
3. Write a query to display the last name, job, department number, and department name
for all employees who work in Toronto.

4. Display the employee full name and department name for all employees who have an i
(lowercase) in their full names.
5. Write a query to display the employee last name, department name, location ID, and
city of all employees who earn a commission.

6. Display the names and hire dates for all employees who were hired before their
managers, along with their manager’s names and hire dates. Label the columns
Employee, Emp_Hired, Manager, and Mgr_Hired. Order the results in descending by
the employee number.

You might also like