Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Salary SQL

Author  Topic 

anirudhbhide
Starting Member

2 Posts

Posted - 2013-06-01 : 08:09:40


I can't understand how they are calculating the new salary in the following example:

If you want to display employee name, current salary, and a 20% increase in the salary for only those employees for whom the percentage increase in salary is greater than 30000 and in descending order of the increased price, the SELECT statement can be written as shown below

SELECT name, salary, salary*1.2 AS new_salary
FROM employee
WHERE salary*1.2 > 30000
ORDER BY new_salary DESC;

How do they come up with the number 1.2 to multiply the existing salary? Please Help.

Thanks!

I am learning.

MuMu88
Aged Yak Warrior

549 Posts

Posted - 2013-06-01 : 08:35:07
20% increase of X = X * 0.2
So after 20% increase the value is 1.2 * X

20% increase of 100 is 100*0.2 = 20
so after 20% increase it will be 1.2 * 100 = 120

Do you get it?
Go to Top of Page

anirudhbhide
Starting Member

2 Posts

Posted - 2013-06-01 : 08:57:43
Yeah thanks! Got it now!

I am learning.
Go to Top of Page
   

- Advertisement -