SlideShare a Scribd company logo
1 of 10
By Mritunjay Sharma
What are JOINS?
 JOINS are used to combine the data across table.
 It is performed by WHERE clause which combine the
specified rows of table.
 A query can contain zero, one, or multiple JOIN
operations.
Types of JOINS
 There are 5 types of JOINS :-
1. Equi – Join
2. Non Equi – Join
3. Outer Join
4. Self Join
5. Inner Join
Outer Join
 The outer join operator is a plus character in
parentheses (+).
 The outer join operator (+) is on the column that
contains the null value.
 An outer join retrieves a row even when one of the
columns in the join contains a null value.
 You perform an outer join by supplying the outer join
operator in the join condition.
Syntax
 SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name=table2.column_name;
Example of Outer Join
 Example : -
 SELECT e.ename, j.jobtitle FROM employee e, job j
WHERE e.empno = j.empno (+);
Types of Outer Join
 Left Outer Join
 Right Outer Join
 Full Outer Join
Left Outer Join
 The left outer join returns a result table with
the matched data of two tables then remaining rows
of the lefttable and null for the right table's column.
 Syntax :-
 select column-name-list from table-name1, table-
name2 on table-name1.column-name = table-
name2.column-name(+);
 Ex :- SELECT * FROM class LEFT OUTER JOIN
class_info ON (class.id=class_info.id);
Right Outer Join
 The right outer join returns a result table with
the matched data of two tables then remaining rows
of the right table and null for the left table's columns.
 Syntax :- select column-name-list from table-name1,
table-name2 on table-name1.column-name(+) = table-
name2.column-name;
 Ex :- SELECT * FROM class RIGHT OUTER JOIN
class_info on (class.id=class_info.id);
Full Outer Join
 The full outer join returns a result table with
the matched data of two table then remaining rows
of both lefttable and then the right table.
 Syntax :- select column-name-list from table-name1
FULL OUTER JOIN table-name2 on table-
name1.column-name = table-name2.column-name;
 Ex :- SELECT * FROM class FULL OUTER JOIN
class_info on (class.id=class_info.id);

More Related Content

What's hot

How to use vlookup in MS Excel
How to use vlookup in MS ExcelHow to use vlookup in MS Excel
How to use vlookup in MS ExcelJaspal Singh
 
10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any JobHitesh Biyani
 
VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHMridul Bansal
 
Joins in databases
Joins in databases Joins in databases
Joins in databases CourseHunt
 
Vlookup - an introduction
Vlookup - an introductionVlookup - an introduction
Vlookup - an introductionvvmenon22
 
Microsoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP FunctionMicrosoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP FunctionExcel
 
If and nested i fs
If and nested i fsIf and nested i fs
If and nested i fsPaulCPLD
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel FunctionsGautam Gupta
 
Relational algebra
Relational algebraRelational algebra
Relational algebraJoshi Vinay
 
VLOOKUP Function - Marelen Talavera - Vivacious Analytic
VLOOKUP Function - Marelen Talavera - Vivacious AnalyticVLOOKUP Function - Marelen Talavera - Vivacious Analytic
VLOOKUP Function - Marelen Talavera - Vivacious AnalyticMaria Elena Acdol-Talavera
 
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchOn if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchRakesh Sah
 
Excel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP FunctionsExcel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP FunctionsMerve Nur Taş
 

What's hot (20)

Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
SQL JOINS- Reena P V
SQL JOINS- Reena P VSQL JOINS- Reena P V
SQL JOINS- Reena P V
 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
 
How to use vlookup in MS Excel
How to use vlookup in MS ExcelHow to use vlookup in MS Excel
How to use vlookup in MS Excel
 
10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job
 
VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCH
 
Join query
Join queryJoin query
Join query
 
Joins in databases
Joins in databases Joins in databases
Joins in databases
 
Vlookup - an introduction
Vlookup - an introductionVlookup - an introduction
Vlookup - an introduction
 
Joins in dbms and types
Joins in dbms and typesJoins in dbms and types
Joins in dbms and types
 
Microsoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP FunctionMicrosoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP Function
 
If and nested i fs
If and nested i fsIf and nested i fs
If and nested i fs
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel Functions
 
Zlookup function
Zlookup functionZlookup function
Zlookup function
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Joins and unions
Joins and unionsJoins and unions
Joins and unions
 
VLOOKUP Function - Marelen Talavera - Vivacious Analytic
VLOOKUP Function - Marelen Talavera - Vivacious AnalyticVLOOKUP Function - Marelen Talavera - Vivacious Analytic
VLOOKUP Function - Marelen Talavera - Vivacious Analytic
 
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchOn if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
 
Excel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP FunctionsExcel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP Functions
 
How to Use VLOOKUP in Excel
How to Use VLOOKUP in ExcelHow to Use VLOOKUP in Excel
How to Use VLOOKUP in Excel
 

Similar to Types of JOINS Explained in SQL (20)

Join in SQL - Inner, Self, Outer Join
Join in SQL - Inner, Self, Outer JoinJoin in SQL - Inner, Self, Outer Join
Join in SQL - Inner, Self, Outer Join
 
joins and subqueries in big data analysis
joins and subqueries in big data analysisjoins and subqueries in big data analysis
joins and subqueries in big data analysis
 
Mysql joins
Mysql joinsMysql joins
Mysql joins
 
V19 join method-c
V19 join method-cV19 join method-c
V19 join method-c
 
Joins.ppt
Joins.pptJoins.ppt
Joins.ppt
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Les04
Les04Les04
Les04
 
Lab4 join - all types listed
Lab4   join - all types listedLab4   join - all types listed
Lab4 join - all types listed
 
Presentation of Joins In Database
Presentation of Joins In DatabasePresentation of Joins In Database
Presentation of Joins In Database
 
App C
App CApp C
App C
 
Structured Query Language
Structured Query LanguageStructured Query Language
Structured Query Language
 
3)12th_L8_Join-Set-Operations.pdf
3)12th_L8_Join-Set-Operations.pdf3)12th_L8_Join-Set-Operations.pdf
3)12th_L8_Join-Set-Operations.pdf
 
JOINS.pptx
JOINS.pptxJOINS.pptx
JOINS.pptx
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Joining
JoiningJoining
Joining
 
SQL PPT on joins
SQL PPT on joinsSQL PPT on joins
SQL PPT on joins
 
Joins
JoinsJoins
Joins
 
types of SQL Joins
 types of SQL Joins types of SQL Joins
types of SQL Joins
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables
 
SQL Joins and View.pptx
SQL Joins and View.pptxSQL Joins and View.pptx
SQL Joins and View.pptx
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

Types of JOINS Explained in SQL

  • 2. What are JOINS?  JOINS are used to combine the data across table.  It is performed by WHERE clause which combine the specified rows of table.  A query can contain zero, one, or multiple JOIN operations.
  • 3. Types of JOINS  There are 5 types of JOINS :- 1. Equi – Join 2. Non Equi – Join 3. Outer Join 4. Self Join 5. Inner Join
  • 4. Outer Join  The outer join operator is a plus character in parentheses (+).  The outer join operator (+) is on the column that contains the null value.  An outer join retrieves a row even when one of the columns in the join contains a null value.  You perform an outer join by supplying the outer join operator in the join condition.
  • 5. Syntax  SELECT column_name(s) FROM table1 FULL OUTER JOIN table2 ON table1.column_name=table2.column_name;
  • 6. Example of Outer Join  Example : -  SELECT e.ename, j.jobtitle FROM employee e, job j WHERE e.empno = j.empno (+);
  • 7. Types of Outer Join  Left Outer Join  Right Outer Join  Full Outer Join
  • 8. Left Outer Join  The left outer join returns a result table with the matched data of two tables then remaining rows of the lefttable and null for the right table's column.  Syntax :-  select column-name-list from table-name1, table- name2 on table-name1.column-name = table- name2.column-name(+);  Ex :- SELECT * FROM class LEFT OUTER JOIN class_info ON (class.id=class_info.id);
  • 9. Right Outer Join  The right outer join returns a result table with the matched data of two tables then remaining rows of the right table and null for the left table's columns.  Syntax :- select column-name-list from table-name1, table-name2 on table-name1.column-name(+) = table- name2.column-name;  Ex :- SELECT * FROM class RIGHT OUTER JOIN class_info on (class.id=class_info.id);
  • 10. Full Outer Join  The full outer join returns a result table with the matched data of two table then remaining rows of both lefttable and then the right table.  Syntax :- select column-name-list from table-name1 FULL OUTER JOIN table-name2 on table- name1.column-name = table-name2.column-name;  Ex :- SELECT * FROM class FULL OUTER JOIN class_info on (class.id=class_info.id);