SlideShare ist ein Scribd-Unternehmen logo
1 von 14
SQL JOINS
http://msbitutor.blogspot.com
2
SQL JOINS
Inner Join
Outer Join
Cross Join
3
SQL JOINS
I.INNER JOIN
Inner join returns only those records that match in both the tables.
Syntax:
Select * from table 1 INNER JOIN
table 2
ON
Table 1.Column 1=table 2.Column 1
4
SQL JOINS
Select * from CountryStatus
Inner Join PRODUCTS
ON
CountryStatus.ProductID=PRODUCTS.ProductID
Result:
QUARY:
5
SQL JOINS
II.OUTER JOIN
Outer Joins are three types
a. Right Outer Join
b. Left Outer Join
c. Full Outer join
6
SQL JOINS
a. Right Outer Join
Right outer join returns all records/rows from right table and from left table
returns only matched records.
Syntax:
Select * from Table 1
Right Outer Join Table 2
ON
Table 1.Column 1=Table 2.Column 1
7
SQL JOINS
QUARY:
Select * from CountryStatus
Right Outer Join PRODUCTS
ON
CountryStatus.ProductID=PRODUCTS.ProductID
RESULT:
8
SQL JOINS
b. Left Outer Join
Left outer join returns all records/rows from left table and from right
table returns only matched records.
Syntax:
Select * from Table 1
Left Outer Join Table 2
ON
Table 1.Column 1=Table 2.Column
1
9
SQL JOINS
RESULT:
QUARY:
Select * from CountryStatus
Left Outer Join PRODUCTS
ON
CountryStatus.ProductID=PRODUCTS.ProductID
10
SQL JOINS
c. Full Outer Join
Full outer join combines left outer join and right outer join. This join
returns all records/rows from both the tables.
Syntax:
Select * from Table 1
Full Outer Join Table 2
ON
Table 1.Column 1=Table 2.Column
1
11
SQL JOINS
QUARY:
Select * from CountryStatus
Full Outer Join PRODUCTS
ON
CountryStatus.ProductID=PRODUCTS.ProductID
RESULT:
12
SQL JOINS
III. Cross Join
This join returns records/rows that are multiplication of record number
from both the tables means each row on left table will related to each row
of right table.
Syntax:
Select * from Table 1
Cross Join Table 2
13
SQL JOINS
QUARY:
Select * from CountryStatus
Cross Join PRODUCTS
RESULT:
14

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
MS Sql Server: Joining Databases
MS Sql Server: Joining DatabasesMS Sql Server: Joining Databases
MS Sql Server: Joining Databases
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Inner join and outer join
Inner join and outer joinInner join and outer join
Inner join and outer join
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL subquery
SQL subquerySQL subquery
SQL subquery
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Join
JoinJoin
Join
 
Join query
Join queryJoin query
Join query
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 
Sql subquery
Sql  subquerySql  subquery
Sql subquery
 
Sql clauses by Manan Pasricha
Sql clauses by Manan PasrichaSql clauses by Manan Pasricha
Sql clauses by Manan Pasricha
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Training
 
SQL
SQLSQL
SQL
 
Index in sql server
Index in sql serverIndex in sql server
Index in sql server
 
Sql select
Sql select Sql select
Sql select
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
 
Oracle Database Sequence
Oracle Database SequenceOracle Database Sequence
Oracle Database Sequence
 

Andere mochten auch (20)

joins in database
 joins in database joins in database
joins in database
 
SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query Optimization
 
SQL Joins
SQL JoinsSQL Joins
SQL Joins
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Server
 
Semi join
Semi joinSemi join
Semi join
 
Sql join
Sql  joinSql  join
Sql join
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 
SQL JOINS- Reena P V
SQL JOINS- Reena P VSQL JOINS- Reena P V
SQL JOINS- Reena P V
 
SQL JOIN Explained Visually
SQL JOIN Explained VisuallySQL JOIN Explained Visually
SQL JOIN Explained Visually
 
Subqueries
SubqueriesSubqueries
Subqueries
 
Sql queires
Sql queiresSql queires
Sql queires
 
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
SQL Joinning.Database
SQL Joinning.DatabaseSQL Joinning.Database
SQL Joinning.Database
 
Tipos de datos oracle
Tipos de datos   oracleTipos de datos   oracle
Tipos de datos oracle
 
Why is Change So Hard in Oracle® Applications?
Why is Change So Hard in Oracle® Applications?Why is Change So Hard in Oracle® Applications?
Why is Change So Hard in Oracle® Applications?
 
Oracle Date Functions
Oracle Date FunctionsOracle Date Functions
Oracle Date Functions
 
Les06 (using subqueries to solve queries)
Les06 (using subqueries to solve queries)Les06 (using subqueries to solve queries)
Les06 (using subqueries to solve queries)
 
Joins
JoinsJoins
Joins
 

Ähnlich wie SQL JOINS Guide - Inner, Outer & Cross Joins Explained

Ähnlich wie SQL JOINS Guide - Inner, Outer & Cross Joins Explained (12)

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
JoinsJoins
Joins
 
21 types of sql joins
21 types of sql joins21 types of sql joins
21 types of sql joins
 
Query processing and data analysis
Query processing and data analysisQuery processing and data analysis
Query processing and data analysis
 
SQL JOIN.pptx
SQL JOIN.pptxSQL JOIN.pptx
SQL JOIN.pptx
 
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
 
V19 join method-c
V19 join method-cV19 join method-c
V19 join method-c
 
types of SQL Joins
 types of SQL Joins types of SQL Joins
types of SQL Joins
 
SQL JOINS.pdf
SQL JOINS.pdfSQL JOINS.pdf
SQL JOINS.pdf
 
SQL Joins.pdf
SQL Joins.pdfSQL Joins.pdf
SQL Joins.pdf
 
SQL_Joins.pdf
SQL_Joins.pdfSQL_Joins.pdf
SQL_Joins.pdf
 
Internal tables
Internal tables Internal tables
Internal tables
 

Kürzlich hochgeladen

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Kürzlich hochgeladen (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

SQL JOINS Guide - Inner, Outer & Cross Joins Explained

  • 3. 3 SQL JOINS I.INNER JOIN Inner join returns only those records that match in both the tables. Syntax: Select * from table 1 INNER JOIN table 2 ON Table 1.Column 1=table 2.Column 1
  • 4. 4 SQL JOINS Select * from CountryStatus Inner Join PRODUCTS ON CountryStatus.ProductID=PRODUCTS.ProductID Result: QUARY:
  • 5. 5 SQL JOINS II.OUTER JOIN Outer Joins are three types a. Right Outer Join b. Left Outer Join c. Full Outer join
  • 6. 6 SQL JOINS a. Right Outer Join Right outer join returns all records/rows from right table and from left table returns only matched records. Syntax: Select * from Table 1 Right Outer Join Table 2 ON Table 1.Column 1=Table 2.Column 1
  • 7. 7 SQL JOINS QUARY: Select * from CountryStatus Right Outer Join PRODUCTS ON CountryStatus.ProductID=PRODUCTS.ProductID RESULT:
  • 8. 8 SQL JOINS b. Left Outer Join Left outer join returns all records/rows from left table and from right table returns only matched records. Syntax: Select * from Table 1 Left Outer Join Table 2 ON Table 1.Column 1=Table 2.Column 1
  • 9. 9 SQL JOINS RESULT: QUARY: Select * from CountryStatus Left Outer Join PRODUCTS ON CountryStatus.ProductID=PRODUCTS.ProductID
  • 10. 10 SQL JOINS c. Full Outer Join Full outer join combines left outer join and right outer join. This join returns all records/rows from both the tables. Syntax: Select * from Table 1 Full Outer Join Table 2 ON Table 1.Column 1=Table 2.Column 1
  • 11. 11 SQL JOINS QUARY: Select * from CountryStatus Full Outer Join PRODUCTS ON CountryStatus.ProductID=PRODUCTS.ProductID RESULT:
  • 12. 12 SQL JOINS III. Cross Join This join returns records/rows that are multiplication of record number from both the tables means each row on left table will related to each row of right table. Syntax: Select * from Table 1 Cross Join Table 2
  • 13. 13 SQL JOINS QUARY: Select * from CountryStatus Cross Join PRODUCTS RESULT:
  • 14. 14