dcsimg
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Tro answer me for the following queries

  1. #1
    Join Date
    Nov 2000
    Posts
    34
    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]

  2. #2
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    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

  3. #3
    Join Date
    Nov 2000
    Posts
    34
    Chris Long,
    Thank's for ur advise. But if u really know try to answer me please.

    admala

  4. #4
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    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

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You may also want to look at the CONNECT BY statement for tree-structured queries...
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width