Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Joins

430 views

Published on

it will give explanation about joins including inner join and left outer join..

  • Be the first to comment

  • Be the first to like this

Joins

  1. 1. Inner Join :Inner join picks only matching records from both (Left and Right side) the tablesInner Join Example : City Code City Name 1011 Hyderabad 1012 Chennai 1013 Bangalore 1014 Bangalore 1018 PuneTable 1.1 ( Consider above table as Left Hand Side Table) City Code City Name 1010 Hyderabad 1012 Chennai 1018 Pune 1019 Kolkata 1020 HyderabadTable 1.2 ( Consider above table as Right Hand Side Table)Yellow Shading gives matching records in both the tablesInner Join Output :According to the above tables(table 1.1, table 1.2) data1012, 1018 records only exist in bothSo Inner Join picks only matching records from both the tablesInner join Output as shown in the below table City Code City Name 1012 Chennai 1018 Pune
  2. 2. Left Outer Join :Left Outer join picks all records from the left side table as well as matching records from both the tablesLeft Outer Join Example: City Code City Name 1011 Hyderabad 1012 Chennai 1013 Bangalore 1014 Bangalore 1020 HyderabadTable : 2.1 ( Consider above table as Left Hand Side Table ) City Code City Name 1011 Hyderabad 1014 Bangalore 1018 Pune 1019 Kolkata 1020 Hyderabad 1021 Chennai 1024 PuneTable : 2.2 ( Consider above table as Right Hand Side Table )Yellow Shading gives matching records in both the tablesLeft Outer Join Output Table :According to the above tables(table 2.1, table 2.2) data1011, 1014, 1020 records only exist in both the tablesAnd also 1011, 1012, 1013, 1014, 1020 records are available in left hand side table (table 2.1)So Left Outer join picks all records from left hand side table (table 2.1) as well as matching records inboth the tables (Table 2.1, Table 2.2)
  3. 3. Left Outer join Output as shown in the below table City Code City Name 1011 Hyderabad 1012 Chennai 1013 Bangalore 1014 Bangalore 1020 HyderabadBy Anil anil.neegineni@gmail.com

×