Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: help me with the query
Comments embedded.
On May 17, 9:07 am, maruf.syful..._at_gmail.com wrote:
> Consider a database table 'employee_salary'. Table schema is as
> follows -
>
> create table employee_salary(
> employeename varchar(20),
> salary integer
> );
Okay, I've considered it. Now what?
>
> The inserted data are as follows -
>
> Employeename | salary
> -------------------|--------
> a | 2300
> b | 1000
> c | 3500
> d | 3100
> e | 2000
>
So there's data in this table, too? What a novel idea.
> Your objective is to construct a SINGLE QUERY which will produce the
> following output -
>
> employeename | salary | percent
> -------------------|--------|-----------
> a | 2300 | 19.08
> b | 1000 | 16.03
> c | 3500 | 11.45
> d | 3100 | 38.17
> e | 2000 | 15.27
> total | 11900 | 100.00
I'm sorry, no, it's not my objective. It's yours, as this is your homework.
>
> The last row of the output indicates the total sum of salaries. The
> column 'percent' indicates the percentage of the associated employees'
> salary out of the total salary.
Yes, I can figure that out. I can also write the query, which won't do you any good as you won't learn anything. You *do* know enough SQL to at least get started? Until you post what you've written to attempt to solve this no one will help you. Demanding others to do your work won't get you anywhere in this newsgroup.
If you need help you have an instructor; you're paying her/his salary with your tuition, so I'd be getting my money's worth.
David Fitzjarrell Received on Thu May 17 2007 - 12:41:18 CDT
![]() |
![]() |