Results 1 to 8 of 8

Thread: interview question

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Answers
    4

    interview question

    Hello,

    It is Interview Quetion,I am joing 5 tables,if query is too long,what i have to do,what are the other option?


  2. #2
    Contributing Member
    Join Date
    Jun 2007
    Answers
    65

    Re: interview question

    other option is to use subquery for example

    select * from table1 where col1 in (select col1 from table2 where col2 in (.................))))


    ----V V----
    Vikas Vaidya
    (Please mark the quote as thanks if u found the answer useful)


  3. #3
    Junior Member
    Join Date
    Feb 2008
    Answers
    17

    Re: interview question

    Then go for coralated sub query...its give better performance also....


  4. #4
    Junior Member
    Join Date
    Jan 2008
    Answers
    1

    Re: interview question

    Hello,

    Your question is not clear. From what I understood and will do

    1. First check how many rows are there in the individual tables that need to be joined.
    2. Then note down the foreign key columns.
    3. Get the data in to temporary table(s) by joining 2 tables at a time which will be easy when writing the final query to output the result set.

    Hope this helps.

    Thanks


  5. #5
    Junior Member
    Join Date
    Mar 2008
    Answers
    2

    Cool Re: interview question

    Hi Nithya !! Jameel here,
    You can go for views as views are compiled select statements and can span across multiple tables


  6. #6
    Contributing Member
    Join Date
    Apr 2008
    Answers
    31

    Smile Re: interview question

    Hai,

    It is very much better to use the sub queries.
    If we use the views it is nested upto 32 levels only..
    If it crossed you may get errors.


  7. #7
    Junior Member
    Join Date
    Apr 2008
    Answers
    1

    Re: interview question

    use the views to simplify tasks


  8. #8
    Junior Member
    Join Date
    Feb 2008
    Answers
    5

    Re: interview question

    views is the best solution for this.....


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