|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
Bro...no offense but this sounds like a straight up question from DB course. You really expect people to do your work for you?
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Need help finishing a code beyond my skill level |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|