Results 1 to 2 of 2

Thread: How to get an employee who has taken maximum number of books?

  1. #1
    Junior Member
    Join Date
    Jun 2015
    Answers
    1

    How to get an employee who has taken maximum number of books?

    Hello

    I have 2 tables

    Emp( EID intger(Pk), Ename varchar2(20), Bid integer)
    Lib(BID integer (Pk), Bname varchar2(20),Eid integer)

    EMP

    EID Ename BID

    1 Kumar 1
    2 Swamy 2
    3 Kiran 3
    4 Vinay 4
    5 Harsha 5




    LIB

    BID Bname EID
    1 Book1 1
    2 Book2 2
    3 Book3 2
    4 Book4 3
    5 Book5 4


    above are the two tables

    here i need to find, who the employee has taken more number of books

    pls help

    Thanks
    Kumar

    Last edited by Kumar Swamy; 06-08-2015 at 06:34 AM.

  2. #2
    Junior Member
    Join Date
    Apr 2015
    Answers
    5

    Re: How to get an employee who has taken maximum number of books?

    Please try following query.


    SELECT EID,ENAME,BNAME
    FROM EMP,LIB
    WHERE EID = BID


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact