adding new colum / salary increase by 15% expressed [message #233142] |
Wed, 25 April 2007 00:26 |
Maple50175
Messages: 16 Registered: April 2007 Location: MA
|
Junior Member |
|
|
Here is another for you guys. Any help will be greatly appreciated.
I need to display the employee number, name, salary; and salary increase by 15% expressed as a whole number.
Then I need to Label the column New Salary. then save it.
SO end the end it should look like this>
its messed up but you get hte idea. first feild is empno, then ename then sale, then new salary.
I need what to type into SQL to get this.
Also is thee any good books out there I could buy to learn this better?
EMPNO ENAME SAL New Salary
------------ ------- ------ -----------
7839 KING 5000 5750
7698 BLAKE 2850 3278
7782 CLARK 2450 2818
7566 JONES 2975 3421
7654 MARTIN 1250 1438
7499 ALLEN 1600 1840
7844 TURNER 1500 1725
7900 JAMES 950 1093
7521 WARD 1250 1438
7902 FORD 3000 3450
7369 SMITH 800 920
7788 SCOTT 3000 3450
7876 ADAMS 1100 1265
7934 MILLER 1300 1495
14 rows selected.
[Mod-edit: Changed formatting]
[Updated on: Wed, 25 April 2007 00:49] by Moderator Report message to a moderator
|
|
|
|
Re: adding new colum / salary increase by 15% expressed [message #233150 is a reply to message #233147] |
Wed, 25 April 2007 00:47 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
I am really sorry if this sounds harsh, please don't take it that way.
Sure, we can provide you the query for this and your other question, but you seem to lack even the most basic of sql knowledge (but you already know, since you asked for a good book). I am afraid any query provided won't be of any help, simply because you don't know what each element of the query means. That would mean that you would depend on us for each and every change in your query-needs.
I wonder how you come up with these specific questions. Do you need to do these for work? For college?
So, if I were you, I would indeed start with a basic sql-tutorial. I am sure there are plenty out on the internet.
oh, and the query you need:
select empno
, ename
, sal
, round(sal * 1.15) "New Salary"
from emp
|
|
|
|
Re: adding new colum / salary increase by 15% expressed [message #233531 is a reply to message #233365] |
Thu, 26 April 2007 08:19 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Maple50175 wrote on Wed, 25 April 2007 18:12 | Yeah it's for both. I just started a new job (just got outta college and im taking night classes for this)
I can't fail this for the 2nd time.
|
You failed this once before already? If you took an entire class and didn't learn how to add 15% to a salary I don't think you are going to get too far as a programmer sorry to say. Again, like Frank said, it is not meant to sound harsh.
|
|
|
|