Muhammad Fahad CMS: 356324: Submitted To: Waqas Ahmed

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

MUHAMMAD FAHAD

CMS: 356324
Submitted to: Waqas Ahmed
17-12-2020

DATABASE SYSTEMS

LAB-7
TASKS
Task-1: Display the departments that are accredited by the quality council.

STEPS
 First we CREATE the table “EMPLOYEE”
 then select the names of the department which are accredited by using the SELECT
clause

Task-2: Display the employees of departments which are not accredited by


the quality council
STEPS
 In this task we use the same table EMPLOYEE
 then select the names of the department which are not accredited by using the SELECT
clause

Task-3 Write a query to output the name, job, empno, deptname and
location for each dept, even if there are no employees.

STEPS
 First, we take the same table “EMPLOYEE” and “DEPARTMENT” from the earlier task
 Then by using RIGHT JOIN we display the data as requested
Task-4: Find the name of the manager for each employee. Include the
following in the output: empno, empname, job and his manager’s
name.

STEPS
 First, we take the same table “EMPLOYEE” and “DEPARTMENT” from the last task
 Then using the join clause and AS clause we display the query as asked
Task-5: Display the details of those who draw the same salary

STEPS
 First, we take the same table “EMPLOYEE” from the last task
 Then using SELF JOIN we display the details of the person that draws same salary as
shown

=====================================================================================

THANK YOU

You might also like