0% found this document useful (0 votes)
66 views8 pages

Muhammad Fahad CMS: 356324: Submitted To: Waqas Ahmed

This document outlines 10 tasks to complete database queries and analyze an employee table. The tasks include using operators like IN, LIKE, and JOIN to select records by department, filter names not starting with E, calculate salaries as manager or total, count managers, and find highest paid employees under each manager. The final bonus task asks to create a schema for a chat app to track message viewing status similar to WhatsApp. Steps are provided for each task to perform the necessary queries.

Uploaded by

Fahad Aqeel
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)
66 views8 pages

Muhammad Fahad CMS: 356324: Submitted To: Waqas Ahmed

This document outlines 10 tasks to complete database queries and analyze an employee table. The tasks include using operators like IN, LIKE, and JOIN to select records by department, filter names not starting with E, calculate salaries as manager or total, count managers, and find highest paid employees under each manager. The final bonus task asks to create a schema for a chat app to track message viewing status similar to WhatsApp. Steps are provided for each task to perform the necessary queries.

Uploaded by

Fahad Aqeel
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/ 8

MUHAMMAD FAHAD

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

DATABASE SYSTEMS

LAB-5
TASKS
Task-1: Select all employees, whose department name is "EE" and "CSE" using
IN operator.

STEPS
 First we CREATE the table “EMPLOYEE”
 then select the names of the employees in department CSE and EE using the IN
Command

Task-2: Display all the details of department, whose name does not start with
‘E’ using LIKE operator.
STEPS
 In this task we use the same table EMPLOYEE
 Then we see the details of the employees whose name does not start with E using not
like function

Task-3: Calculate the 4th times salary of all employees, who are woking as
‘Manager’ and display complete data of employee

STEPS
 First, we take the same table “EMPLOYEE” from the earlier task
 We multiply the salary of every MANAGER by 4 using the SELECT AS command
Task-4: Count and display the total employees working as ‘MANAGER’.

STEPS
 First, we take the same table “EMPLOYEE” from the last task
 Then we count the number of MANAGER in the JOB column using the Count() command

Task-5: Calculate and display the total salary (salary + commission) of the
employees.

STEPS
 First, we take the same table “EMPLOYEE” from the last task
 Now using the sum command we add the salary and commission and show it in a
separate box

Task-6: Display total salary spent for employees who are working as
‘Manager’.
STEPS
 First, we take the same table “EMPLOYEE” from the task
 Now we add the salary of all the MANAGER using the SUM command
 The results are shown

Task-7: List all employee names, DOJ, salary and 30% rise in salary.

STEPS
 First, we take the same table “EMPLOYEE” from the Task
 Then we Add an additional column SalarRise
 Then we update the SalarRise using the formula above
 Then using the SELECT command display the output

Task-8 : Display highest paid employee details under each manager.


STEPS
 First, we take the same table “EMPLOYEE” from the last Task
 Then using a SUB QUERY we display the employee with the highest salary using the
max() command
 The results are shown

Task-9 Display number of employees working in each department and


their department name.

STEPS
 First, we take the same table “EMPLOYEE” from the Task
 Then we Add an additional column CountOf
 Then we using HAVING and GROUP BY command we display the count of the
depatments
 Then using the SELECT command display the output
*BONUS*

Task-10 : Create the schema of feature chat app, where user seen the
message or not. (like whatsapp) refer to below image.

STEPS
 First, we create a Database
 Then we create a table “WHATSAPP” for a user with all its details as entities
 The results are shown below
OUTPUT

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

THANK YOU

You might also like