If the employee has joined more than 31 years


Write a query to display the ENAME, SAL, COMM, HIREDATE, NEW_SAL. The NEW_SAL will be calculated by the following rule:
a. If the employee has joined more than 31 years(as of the date the report is running), then new salary is going to be 1.2 of the old sal, PLUS comm.divided by 12. If there is not commission, treat it as 0.
b. If the employee has joined more than 30 years but less than 31 years(as of the date the report is running), then new salary is going to be 1.08 of the old sal, PLUS comm. Divided by 15, if there is no commission, treat it as $3.
c. If the employee has joined less than 30 years, then new salary is going to be the old salary PLUS $100. 

Hint: (divide the number of days being hired by 10 years and use TRUNC() function, then decode())
Display the SAL/NEW_SAL with a $ sign in front and using comma ',' to separate thousands
Display the HIREDATE with the format like the following:
Sort the result by the HIREDATE ascending order, then by the new salary descending order.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: If the employee has joined more than 31 years
Reference No:- TGS085421

Expected delivery within 24 Hours