Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Using subquery, display first_name and the salary without decimal places and give the column name as mysalary from f_staffs table, whose id is same

image text in transcribed

4. Using subquery, display first_name and the salary without decimal places and give the column name as mysalary" from f_staffs table, whose id is same as the ID of the staff whose staff_type is belonging to "Manager, and whose first_name has first four characters as Moni. Arrange the output on "first_name" in an order from z to a. [6 Marks) 5. Using subquery, display Manager_id, highest salary for each manager_id from Employees table, whose manager_id is belongs to 100,101,205, and whose highest salary is below to all the employees, those employees do not have the bonus. Arrange the output on manager_ID from highest to lowest. [6 Marks) 6. Design a SQL query that correctly uses the CASE function and DEPARTMENTS table to display DEPARTMENT_NAME, divide the LOCATION_ID by DEPARTMENT_ID, if the remainder is null then replace with 20 and name the column as "Manager Reference". A new column named as "Status" using a column DEPARTMENT_ID, with the case expression as follows; If the DEPARTMENT_ID is 10, display "Administration" If the DEPARTMENT_ID is 20, display Marketing" If the DEPARTMENT_ID is 50, display "Shipping" Otherwise, display "Other Departments" Restrict the output for all Department where the Manager_ld is below 200. Arrange the output by Department_Name from A to Z. [6 Marks) 7. Create a view and name it as NewPopulation using WF_COUNTRIES table with the columns of Country_Name, Population with 2 decimal places and label it as NewPopulation", MEDIAN_AGE with the name of "M_Age". Restrict the output for all WF_COUNTRIES, which AREA is less than 5000 and COUNTRY_NAME ends with letter "e" or which is not having AIRPORTS. Arrange the output on MEDIAN_AGE from lowest to highest. [6 Marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions