Home » SQL & PL/SQL » SQL & PL/SQL » adding new colum / salary increase by 15% expressed
adding new colum / salary increase by 15% expressed [message #233142] Wed, 25 April 2007 00:26 Go to next message
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 #233147 is a reply to message #233142] Wed, 25 April 2007 00:36 Go to previous messageGo to next message
Maple50175
Messages: 16
Registered: April 2007
Location: MA
Junior Member
So would it be


SQL> Select empno, name, salary;
FROM salary
Where Salary ("15%")



Re: adding new colum / salary increase by 15% expressed [message #233150 is a reply to message #233147] Wed, 25 April 2007 00:47 Go to previous messageGo to next message
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 #233365 is a reply to message #233142] Wed, 25 April 2007 17:12 Go to previous messageGo to next message
Maple50175
Messages: 16
Registered: April 2007
Location: MA
Junior Member
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.

So yeah


I see
Re: adding new colum / salary increase by 15% expressed [message #233531 is a reply to message #233365] Thu, 26 April 2007 08:19 Go to previous messageGo to next message
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.
Re: adding new colum / salary increase by 15% expressed [message #233554 is a reply to message #233531] Thu, 26 April 2007 10:20 Go to previous message
Maple50175
Messages: 16
Registered: April 2007
Location: MA
Junior Member
Oh im not here for programming


Major is information Science/ Web design. I design not a programmer at all Sad
Previous Topic: update a column using a column from another table
Next Topic: how to generate text file using spool command using Pl/SQL procedure
Goto Forum:
  


Current Time: Sun Dec 01 10:42:22 CST 2024