Vishal Prajapati
What is the difference between inner and outer join? Explain with example.
By Vishal Prajapati in Databases & DBA on May 03 2016
  • Naresh Tottempudi
    Mar, 2018 1

    Inner join get data of matching records from tables only. Outer join get data even there is no match found in another table

    • 1
  • tayyab hussain
    Jan, 2018 31

    Inner join is join where all matched rows returned.there are no single outer join,there are left outer join and right outer join.if you use left outer join it will return results of matched rows and also return rows Left table.if you use left outer join it will return results of matched rows and also return rows right table.Example of inner join: select * from emp e inner join dept d on e.empid=d.empidExample of left outer join: select * from emp e left outer join dept d on e.empid=d.empidExample of right outer join: select * from emp e right outer join dept d on e.empid=d.empid

    • 1
  • Ashish Srivastava
    Dec, 2017 21

    https://www.essentialsql.com/what-is-the-difference-between-an-inner-and-outer-join/

    • 1
  • Vishal Prajapati
    May, 2016 3

    nner JoinInner join is the most common type of Join which is used to combine the rows from two tables and create a result set containing only such records that are present in both the tables based on the joining condition (predicate).where asOuter JoinOuter Join, on the other hand, will return matching rows from both tables as well as any unmatched rows from one or both the tables (based on whether it is single outer or full outer join respectively).

    • 1
  • Saurabh Vasani
    Jul, 2019 26

    Main difference between Inner join and outer join is that Inner join select the records between tables that are matching and ignore Non-matching records.
    And for Outer join first we need to unserstand that Outer join is classified into 2 types

    1.Left Outer Join
    2.Right outer Join

    We can use Left outer Join when we want to select all the records from the Left Table and matching records from the both tables , same for right outer join we can use right outer join when we want all the data from the Right tables along with the matching records from the both tables.

    Hope this will help….

    • 0
  • Sourav Mukherjee
    Dec, 2018 6

    This is one of the common questions I see in any Interview :)

    • 0
  • Aniket Rana
    Apr, 2018 13

    https://www.w3schools.com/sql/sql_join.asp

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS