Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    1

    Unanswered: nid help in writing a query pls help tnx! :D

    4. Show the following details for any employee who earns a salary greater

    than the average for their department. Sort in department number order.

    without using top or set.


    ename salary deptno
    -------------- ----------------- -----------
    KING 5000.00 10
    JONES 2975.00 20
    FORD 3000.00 20
    SCOTT 3000.00 20
    ALLEN 1600.00 30
    BLAKE 2850.00 30

    (6 row(s) affected)



    In which year did most people join the company? Display the year

    and the number of employees.



    year no_of_emp
    ----------- -----------
    1984 8

    (1 row(s) affected)



    Write a query to display an "*" against the row of the most recently

    hired employee. Display ename, hiredate and the column maxdate showing "*.


    ename hiredate maxdate
    ------------- ----------- -------
    ADAMS Jun 4 1984
    ALLEN Aug 15 1983
    BLAKE Jun 11 1984
    CLARK May 14 1984
    FORD Dec 5 1983
    JAMES Jul 23 1984 *
    JONES Oct 31 1983
    KING Jul 9 1984
    MARTIN Dec 5 1983
    MILLER Nov 21 1983
    SCOTT Mar 5 1984
    SMITH Jun 13 1983
    TURNER Jun 4 1984
    WARD Mar 26 1984

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry, friend, you came to the wrong site

    we won't do your homework for you
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Want to show us your attempts at answering these? We might be able to point you in the right direction if you show some initiative
    George
    Home | Blog

Posting Permissions

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