SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 9th, 2004, 04:45 PM
Devilish Devilish is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 Devilish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Need help finishing a code beyond my skill level

Okay....This the last & final question I have to do
and it's pretty much beyond my skill level. The question is:

Display alphabetically the name, employee number and salary of all employees who manage employees and also display the number of employees they manage, the number of commissioned employees they manage, the total salary of their employees and the total compensation of their employees (salary plus commission) for all management employees who manage fewer than the average number of employees.


It's only dealing with one table with the following attributes
EMP_NO
ENAME
FNAME
JOB
MGR
HIREDATE
SAL
COMM
DEPT_NO


thus far my code is:
select ename "Name", emp_no "Emp No",
job "Job", round(sal,2) "Salary"
from employee
where emp_no IN
(select mgr
from employee)


//*So far I've managed to single out all the employees
who mange other employees, but I don't know how to count

the number of employees each manager manages*//


a simple select * of this table produces the following sample output

Name Emp No MGR Job Salary
-------------------- ---------- ---------- --------------- ----------
King 109 President 10000
Clark 107 109 Manager 4900
Smith 104 109 Manager 5950
Mohammed 110 104 Developer 3000
Martin 105 104 Developer 2500
Huang 102 104 Developer 2500
Cohen 101 104 Developer 3200
Jablonski 111 109 Manager 5700
Ramirez 106 107 Developer 2200
Scott 108 107 Analyst 45000

Reply With Quote
  #2  
Old August 19th, 2004, 01:06 AM
ProEdge's Avatar
ProEdge ProEdge is offline
Contributing User
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2004
Location: Somewhere I belong
Posts: 1,565 ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 17 h 7 m 15 sec
Reputation Power: 39
Bro...no offense but this sounds like a straight up question from DB course. You really expect people to do your work for you?

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Need help finishing a code beyond my skill level


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT