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.
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 belowSELECT name, salary, salary*1.2 AS new_salaryFROM employeeWHERE salary*1.2 > 30000ORDER 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.2So after 20% increase the value is 1.2 * X20% increase of 100 is 100*0.2 = 20so after 20% increase it will be 1.2 * 100 = 120Do you get it? |
 |
|
anirudhbhide
Starting Member
2 Posts |
Posted - 2013-06-01 : 08:57:43
|
Yeah thanks! Got it now!I am learning. |
 |
|
|
|
|