0% found this document useful (0 votes)
7 views

Assignment

Uploaded by

ro6162
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Assignment

Uploaded by

ro6162
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Q1.

Same managerSQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

Extract all the employees who work under the same manager. Return manager_id and
managers full name (first name , last name separated by space) as 'Manager' and
employee's full name (first name , last name separated by space) as 'Employee'.

Dataset Description:

Q2. Net SalarySQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

Use CTE's. Add 5000 for every employee's salary and save the column as 'Net_salary' and
display all the details like employee_id,first_name, last_name, salary , 'Net_salary' of
those employees whose net salary is greater than 20000.

Dataset Description:
Note: Select MySQL 8.0 in the drop-down.

Q3. If nullSQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

Use CTE's. Calculate the net salary for the employees and save the column as
'Net_salary' and display all the details like employee_id,first_name, last_name, salary ,
'Net_salary' of those employees whose net salary is greater than 15000.

Note: To calculate the 'Net_salary' = salary + salary *(comission_pct). If the column


'comission_pct' consists of null values replace them with zeros using the ifnull()
function. For example: ifnull(comission_pct,0)

Dataset Description:
Note: Select MySQL 8.0 in the drop-down.

Q4. Dept 80SQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

Display all the employee information who work for department number 80 or have
salary more than 10000 using Union for employees table.

Dataset Description:
Q5. Emp viewSQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

create a view as 'emp_view' that has the details like employee_id, first_name,
last_name, salary, department_id, department_name, location_id, street_address, city.
Print from the view of all those employees who are from the cities Seattle or Southlake
and display all the records in the emp_view.

Dataset Description:

Q6. ManagerSQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

Extract all the id's of the managers(only distinct values) from both the "Employees" and
the "Departments" table.

Dataset Description:
Q7. 12th highestSQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

Use CTEs and display the 12th highest salary from the employee's table.

Dataset Description:

Note: Select MySQL 8.0 in the drop-down.


Q8. Manager detailsSQLUnsolved

Stuck somewhere?
Ask for help from a TA and get it resolved.
Get help from TA.

Problem Statement:

Create a view as 'Manager_details' with Manager's employee id, manager's name(first


name and last name separated by space) as 'Manager' salary, phone number,
department id and name, street address, city, country name. Display the details
employee_id, Manager, salary, and department_name from the view 'Manager_details'
of those Top 5 managers with the highest salary.

Dataset Description:

You might also like