Home  
 
  Ask Questions  
 
  Feed Back  
 
  My Questions  
 
  Contact Us  
 
  About Us  
 
 Interview Questions  
 Our Services  

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!



    Send your Resume to 6000 Companies

  • NEW INTERVIEW QUESTIONS.COM DATABASE INTERVIEW QUESTIONS SQL SERVER INTERVIEW QUESTIONS DETAILS


    NewInterviewQuestions.com - Home for World's Largest Interview Questions Website.

    A D V E R T I S E M E N T




    Add to My Questions Add to My Questions | Forward Forward | Print Print


    Question Question What is the difference between Inner join and full outer join in terms of the Number of rows returned?

    Answer Answer Inner Join will return rows that have matching records in both table, but in case of full outer join it will return all records from left table and from right table.

    In Left-Outer join all the record from the left-most table will be fetched and if records found in the 2nd table then field values will be displayed else it will display Null in the 2nd table fields.

    Ex.
    Create table EMPNAME (ID int, EMPNAME varchar(20))
    CREATE table EMPADDRESS (ID int, ADDRESS varchar(20))

    INSERT INTO EMPNAME VALUES(1, 'DEEPAN')
    INSERT INTO EMPNAME VALUES(2, 'RAMESH')
    INSERT INTO EMPNAME VALUES(3, 'PRADEEP')
    INSERT INTO EMPADDRESS VALUES(1, 'BANGALORE')
    INSERT INTO EMPADDRESS VALUES(2, 'DELHI')
    INSERT INTO EMPADDRESS VALUES(4, 'DELHI')

    SELECT * FROM EMPNAME
    ID EMPNAME
    ----------- --------------------
    1 DEEPAN
    2 RAMESH
    3 PRADEEP


    SELECT * FROM EMPADDRESS
    ID ADDRESS
    ----------- --------------------
    1 BANGALORE
    2 DELHI
    4 DELHI

    Example : INNER JOIN
    ===================================================================
    SELECT EMPNAME.ID, EMPNAME.EMPNAME, EMPADDRESS.ADDRESS FROM EMPNAME
    JOIN EMPADDRESS ON EMPADDRESS.ID = EMPNAME.ID

    Output of the above JOIN Query (i.e Inner Query)
    -----------------------------------------------------
    ID EMPNAME ADDRESS
    ----------- -------------------- --------------------
    1 DEEPAN BANGALORE
    2 RAMESH DELHI

    Example : FULL OUTER JOIN
    ===================================================================
    SELECT EMPNAME.ID, EMPNAME.EMPNAME, EMPADDRESS.ADDRESS FROM EMPNAME
    FULL OUTER JOIN EMPADDRESS ON EMPADDRESS.ID = EMPNAME.ID

    Output of the above FULL OUTER JOIN Query
    -----------------------------------------------------
    ID EMPNAME ADDRESS
    ----------- -------------------- --------------------
    1 DEEPAN BANGALORE
    2 RAMESH DELHI
    3 PRADEEP NULL
    NULL NULL DELHI

    Example : LEFT OUTER JOIN
    ===================================================================
    SELECT EMPNAME.ID, EMPNAME.EMPNAME, EMPADDRESS.ADDRESS FROM EMPNAME
    LEFT OUTER JOIN EMPADDRESS ON EMPADDRESS.ID = EMPNAME.ID

    Output of the above LEFT OUTER JOIN Query
    -----------------------------------------------------
    ID EMPNAME ADDRESS
    ----------- -------------------- --------------------
    1 DEEPAN BANGALORE
    2 RAMESH DELHI
    3 PRADEEP NULL

    Example : RIGHT OUTER JOIN
    ===================================================================
    SELECT EMPNAME.ID, EMPNAME.EMPNAME, EMPADDRESS.ADDRESS FROM EMPNAME
    RIGHT OUTER JOIN EMPADDRESS ON EMPADDRESS.ID = EMPNAME.ID

    Output of the above RIGHT OUTER JOIN Query
    -----------------------------------------------------
    ID EMPNAME ADDRESS
    ----------- -------------------- --------------------
    1 DEEPAN BANGALORE
    2 RAMESH DELHI
    NULL NULL DELHI


    merge means combine the two data floders adding

    Answered By: nagaraj    Date: 4/2/2007

    © NewInterviewQuestions.com


    If you have the better answer, than send it to us. We will display your answer after the approval.
    Answer Answer:*
    Name Name:*
    Email Address Email Address:*
         Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
     


    Rate the above answer. Help us to know about the answer.
    Category Category SQL Server Interview Questions
    Rating Rating (5.0) By 2 users
    Added Added 8/12/2006
    Views Views 153742
    Rate it Rate it!
    Free Offers Free Offers: 300 Free Magazines for you. No credit card required. No Shipping Charges. Absolutely Free for 1 Year.

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:


    A D V E R T I S E M E N T





     Sponsors  
    Latest 10 Answers
    Satellite assemblies are purely based on culture,these are loaded dynamically.
    Cache is the memory that services thr CPU.It is faster than the main memory and allows the CPU to execute instructions and read and write data at a higher speed.
    Bank reconciliation is a Statement prepared by the customer to find out the differences in the cash book prepared by him and the pass book given by the bank.
    Asp. net is event driven, code is separated from the html,events are handles on server side. and asp.net uses the compiled code while asp interprets the code.
    Controls which does not have align property cannot be placed in MDI forms.
    A DSN (Data Source Name) is an identifier which defines a data source for an ODBC driver. A DSN consists of information such as: Database name Directory Database driver User ID Password
    The serialization is a process in which we can stored in data in the persistence medium like file ,hard disk etc ...in a serialize form...
    Line and Shape controls dont have a events.
    ABAP is basic (technical) side of SAP. which helps other function of business sibe ex.financial,sales,inventory& human resource.
    Cluster index work as a primary key and as we know in a single table only one primary key should be there....Hence only one records can take cluster index.

    G o o g l e Search

    Google

    Newinterviewquestions.com is a part of Vyom Network. Top



    Copyright ? 2008, newinterviewquestions.com. All rights reserved Privacy Policy

    Page URL: http://www.newinterviewquestions.com/interview/10633/Default.asp?cachecommand=bypass


    Download Yahoo Messenger