-
id name title emp_id
0008 Jeff VP 0004
1001 Mark Manager 0008
1002 John Manager 0008
1003 vis P/A 1001
1004 Mary Sr. P/A 1001
1005 Rob DA 1002
1006 son DBA 1001
1007 Will SA 1002
(1) Write a query to find employee id for all employees who have more than 10 people directly report to him/her.
(2) Write a query to list all columns for employees who has more than 20 people directly report to him/her
(3) Write a query to find id, name,
emp_id, name for all employees
whose supervier’s job title is ‘Manager’
(4) Assume the EMPLOYEES table has more then 50,000,000 records, and the only index in this table is emp_id. Write a query to find emp_id for all employees who do not have any one work under him/her. Please consider the efficiency.
Please try to answer me ASAP
Thanks in advance.
Praveen
[Edited by admala on 12-20-2000 at 07:50 PM]
-
I'm sorry, but my morals (however shallow they may be in most other aspects) preclude me from answering somebody else's homework assignments :)
Sorry,
- Chris
-
Chris Long,
Thank's for ur advise. But if u really know try to answer me please.
admala
-
Sorry bud, but if you can't answer these, you need to crack the books a little harder. They don't get much easier than this. I'll give you the first one to give you an idea of what to look for.
SELECT
---EMP_ID
FROM
---EMP
GROUP BY
---EMP_ID
HAVING
---COUNT(*) > 10
Remember to remove the dashes. I only put them there to properly indent the statement. This silly forum software insists on annoyingly left-justifying every line of text.
But really, next time ask a classmate.
Good luck on the final,
- Chris
-
You may also want to look at the CONNECT BY statement for tree-structured queries...