SlideShare a Scribd company logo
1 of 19
Topic: Joins in Database
Under the guidance of
Dr. Sheelesh kumar Sharma
Submitted to:- Submitted by:-
MCA Department Shashank Pathak
IMS Ghaziabad MCA 3rd Year
Joins
1. Join is a special form of cross product of two tables.
Join=(Cross Product + Select Statement(Conditions)
2. In Cartesian product we join a tuple of one table with the tuples of the
second table. But in join there is a special requirement of relationship
between tuples.
 For example if there is a relation STUDENT and a relation BOOK then it
may be required to know that how many books have been issued to any
particular student. Now in this case the primary key of STUDENT that is
stId is a foreign key in BOOK table through which the join can be made.
Types
1. Cross Join.
2. Natural Join.
3. Equi(Inner Join).
4. Self Join.
5. Outer Join-
• Left Outer Join.
• Right Outer Join.
• Full Outer Join.
Eno Ename Address
1 Kiran Delhi
2 Sita Banaras
3 Amrit Mohali
4 Veeru Delhi
Dno Dname Eno
D1 HR 1
D2 IT 2
D3 Sales 4
D4 Finance 3
Tables
Department TableEmployee Table
Cross Join
1. Cross join where there is no clause specified.
2. In mathematics, it is a set of all pairs of elements (x, y) that can be
constructed from given sets, X and Y, such that x belongs to X and y to Y.
3. It defines a relation that is the concatenation of every tuple of relation R
with every tuple of relation S.
Query:
SQL>select * from employee,department;
OR
SQL>select * from employee cross join department;
Natural Join
• Natural Join joins two tables based on same attribute.
• The resulting table will contains all the attribute of both table but keep
only one each common fields.
• Natural join is denoted by binary operator( ) , written as (A B)
where A and B are relations.
• In particular, natural join allows the combination of relations that are
associated by a foreign key.
Normal Query:-
SQL>select * from employee where employee, department where emp.eno=dept.eno;
Joins:
SQL>select * from employee natural join department;
Natural Join(Example)
Eno Ename Address Deptno Dname
1 Kiran Delhi D1 HR
2 Sita Banaras D2 IT
4 Veeru Delhi D3 Sales
3 Amrit Mohali D4 Finance
Equi Join/Inner Join
1. Inner join is used to select all records from table A, B where the join
condition is meet.
2. An inner join is the most common join operation used in applications and
can be regarded as the default join-type.
3. Inner join create a new result table by combinning column values of two
table A,B based upon the join-preducate.
4. The query compares each row of A with each row of B to find all pairs of
rows which satisfy the join-predicate. When the join-statement is
satisfied, column values for each matched pair of rows of A and B are
combined into a result row.
Inner Join(Example)
Query:-
SQL:- select e.eno,e.ename from employee e inner join department on e.eno=d.eno;
Eno Ename
1 Kiran
2 Sita
4 Veeru
3 Amrit
Self Join
1. A self-join is joining a table to itself. This is best illustrated by an
example.
2. A query to find all pairings of two employees in the same country is
desired.
3. If there were two separate tables for employees and a query which
requested employees in the first table having the same country as
employees in the second table, a normal join operation could be used to
find the answer table. However, all the employee information is contained
within a single large table.
Self Join(Example)
Query:-
SQL>select e1.eno, e2.eno from employee e1, employee e2 where e1.eno=e2.eno;
Eno Ename
1 Kiran
2 Sita
3 Amrit
4 Veeru
Outer Join
1. If there are any values in one table and that is not present in another table,
in an inner join/equi join that row will not be selected. Such row can be
forcefully selected by using the outer join symbol(+).
2. Example:
SQL> select * from employee e, department d where e.eno(+)=d.eno;
3. Outer join further divided into three parts:
• Left Outer join.
• Right Outer join.
• Full Outer join.
Left Outer Join
1. The result of Left outer join(or simple left join) for table A and B always
contains all records of the “left table(A)”, even if the join-condition does
not find any matching record in the “right table(B)”
2. This means that if the ON clause matches 0(zero) records in B, the join will
still return a row in the result but with NULL in each column from B.
3. This means that a left outer join returns all the values from the left table,
plus matched values from the right table (or NULL in case of no matching
join predicate).
4. If the right table returns one row and the left table returns more than one
matching row for it, the values in the right table will be repeated for each
distinct row on the left table.
Query:-
SQL>select e.eno,e.ename from employee e left outer join department d on
e.eno=d.eno;
Eno Ename Address Dno Dname Eno
1 Kiran Delhi D1 HR 1
2 Sita Banaras D2 IT 2
3 Amrit Mohali D4 Finance 3
4 Veeru Delhi D3 Sales 4
Right Outer Join
1. A right outer join closely resembles a left outer join except with the
treatment of the tables reserved. Every row from the “right table”.
2. B will appear in the joined table at least once. If no matching row from
the ''left” table(A) exists, NULL will appear in cloumns from table A
for those recprds that have no match in B. A right outer join returns all
the values from the right table and matched values from the left
table(NULL in case of no matching join predicate).
Query:-
SQL>select * from employee e right outer join department d on e.eno=d.eno;
Eno Ename Address Dno Dname Eno
1 Kiran Delhi D1 HR 1
2 Sita Banaras D2 IT 2
4 Veeru Delhi D3 Sales 4
3 Amrit Mohali D4 Finance 3
Full Outer Join
1. A full outer join combines the effect of applying both left and right outer
joins. Where records in the full outer joined table that do not matched, the
result set will have NULL values for every column of the table that have
lacks matching row. For those records that do match, a single row will be
produced in the result set(containing fields populated from both tables).
2. Select all records from table(A) and table(B) regardless of whether the
join condition is meet or not.
Query:
SQL> select * from employee e full outer join department d on e.eno=d.eno;
Eno Ename Address Dno Dname Eno
1 Kiran Delhi D1 HR 1
2 Sita Banaras D2 IT 2
4 Veeru Delhi D3 Sales 4
3 Amrit Mohali D4 Finance 3
Thankyou

More Related Content

What's hot (20)

Sql joins
Sql joinsSql joins
Sql joins
 
Sql join
Sql  joinSql  join
Sql join
 
Spread sheet tools presentation
Spread sheet tools presentationSpread sheet tools presentation
Spread sheet tools presentation
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
Sql joins
Sql joinsSql joins
Sql joins
 
SQL
SQLSQL
SQL
 
Sql joins
Sql joinsSql joins
Sql joins
 
SQL JOINS- Reena P V
SQL JOINS- Reena P VSQL JOINS- Reena P V
SQL JOINS- Reena P V
 
Week2 excel
Week2 excelWeek2 excel
Week2 excel
 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
 
Ms excel 2013 data management
Ms excel 2013 data managementMs excel 2013 data management
Ms excel 2013 data management
 
SQL Join's
SQL Join'sSQL Join's
SQL Join's
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Excel Data Management
Excel Data ManagementExcel Data Management
Excel Data Management
 
Join query
Join queryJoin query
Join query
 
Basic Formulas - Excel 2013 Tutorial
Basic Formulas - Excel 2013 TutorialBasic Formulas - Excel 2013 Tutorial
Basic Formulas - Excel 2013 Tutorial
 
Using formula and function
Using formula and functionUsing formula and function
Using formula and function
 
Ms excel ppt
Ms   excel pptMs   excel ppt
Ms excel ppt
 
Office technology
Office technology Office technology
Office technology
 

Similar to Database Joins Explained

Similar to Database Joins Explained (20)

Mysql joins
Mysql joinsMysql joins
Mysql joins
 
MS SQL SERVER: Joining Databases
MS SQL SERVER: Joining DatabasesMS SQL SERVER: Joining Databases
MS SQL SERVER: Joining Databases
 
MS SQLSERVER:Joining Databases
MS SQLSERVER:Joining DatabasesMS SQLSERVER:Joining Databases
MS SQLSERVER:Joining Databases
 
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
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Advance database system(part 8)
Advance database system(part 8)Advance database system(part 8)
Advance database system(part 8)
 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...
 
V19 join method-c
V19 join method-cV19 join method-c
V19 join method-c
 
joins in database
 joins in database joins in database
joins in database
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables
 
Les04
Les04Les04
Les04
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive
 
SQL PPT on joins
SQL PPT on joinsSQL PPT on joins
SQL PPT on joins
 
JOINS.pptx
JOINS.pptxJOINS.pptx
JOINS.pptx
 
Joins
JoinsJoins
Joins
 
types of SQL Joins
 types of SQL Joins types of SQL Joins
types of SQL Joins
 
SQL Joins and View.pptx
SQL Joins and View.pptxSQL Joins and View.pptx
SQL Joins and View.pptx
 
Cash flow using excel
Cash flow using excelCash flow using excel
Cash flow using excel
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx
 
database .pptx
database .pptxdatabase .pptx
database .pptx
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
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...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Database Joins Explained

  • 1. Topic: Joins in Database Under the guidance of Dr. Sheelesh kumar Sharma Submitted to:- Submitted by:- MCA Department Shashank Pathak IMS Ghaziabad MCA 3rd Year
  • 2. Joins 1. Join is a special form of cross product of two tables. Join=(Cross Product + Select Statement(Conditions) 2. In Cartesian product we join a tuple of one table with the tuples of the second table. But in join there is a special requirement of relationship between tuples.  For example if there is a relation STUDENT and a relation BOOK then it may be required to know that how many books have been issued to any particular student. Now in this case the primary key of STUDENT that is stId is a foreign key in BOOK table through which the join can be made.
  • 3. Types 1. Cross Join. 2. Natural Join. 3. Equi(Inner Join). 4. Self Join. 5. Outer Join- • Left Outer Join. • Right Outer Join. • Full Outer Join.
  • 4. Eno Ename Address 1 Kiran Delhi 2 Sita Banaras 3 Amrit Mohali 4 Veeru Delhi Dno Dname Eno D1 HR 1 D2 IT 2 D3 Sales 4 D4 Finance 3 Tables Department TableEmployee Table
  • 5. Cross Join 1. Cross join where there is no clause specified. 2. In mathematics, it is a set of all pairs of elements (x, y) that can be constructed from given sets, X and Y, such that x belongs to X and y to Y. 3. It defines a relation that is the concatenation of every tuple of relation R with every tuple of relation S. Query: SQL>select * from employee,department; OR SQL>select * from employee cross join department;
  • 6. Natural Join • Natural Join joins two tables based on same attribute. • The resulting table will contains all the attribute of both table but keep only one each common fields. • Natural join is denoted by binary operator( ) , written as (A B) where A and B are relations. • In particular, natural join allows the combination of relations that are associated by a foreign key. Normal Query:- SQL>select * from employee where employee, department where emp.eno=dept.eno; Joins: SQL>select * from employee natural join department;
  • 7. Natural Join(Example) Eno Ename Address Deptno Dname 1 Kiran Delhi D1 HR 2 Sita Banaras D2 IT 4 Veeru Delhi D3 Sales 3 Amrit Mohali D4 Finance
  • 8. Equi Join/Inner Join 1. Inner join is used to select all records from table A, B where the join condition is meet. 2. An inner join is the most common join operation used in applications and can be regarded as the default join-type. 3. Inner join create a new result table by combinning column values of two table A,B based upon the join-preducate. 4. The query compares each row of A with each row of B to find all pairs of rows which satisfy the join-predicate. When the join-statement is satisfied, column values for each matched pair of rows of A and B are combined into a result row.
  • 9. Inner Join(Example) Query:- SQL:- select e.eno,e.ename from employee e inner join department on e.eno=d.eno; Eno Ename 1 Kiran 2 Sita 4 Veeru 3 Amrit
  • 10. Self Join 1. A self-join is joining a table to itself. This is best illustrated by an example. 2. A query to find all pairings of two employees in the same country is desired. 3. If there were two separate tables for employees and a query which requested employees in the first table having the same country as employees in the second table, a normal join operation could be used to find the answer table. However, all the employee information is contained within a single large table.
  • 11. Self Join(Example) Query:- SQL>select e1.eno, e2.eno from employee e1, employee e2 where e1.eno=e2.eno; Eno Ename 1 Kiran 2 Sita 3 Amrit 4 Veeru
  • 12. Outer Join 1. If there are any values in one table and that is not present in another table, in an inner join/equi join that row will not be selected. Such row can be forcefully selected by using the outer join symbol(+). 2. Example: SQL> select * from employee e, department d where e.eno(+)=d.eno; 3. Outer join further divided into three parts: • Left Outer join. • Right Outer join. • Full Outer join.
  • 13. Left Outer Join 1. The result of Left outer join(or simple left join) for table A and B always contains all records of the “left table(A)”, even if the join-condition does not find any matching record in the “right table(B)” 2. This means that if the ON clause matches 0(zero) records in B, the join will still return a row in the result but with NULL in each column from B. 3. This means that a left outer join returns all the values from the left table, plus matched values from the right table (or NULL in case of no matching join predicate).
  • 14. 4. If the right table returns one row and the left table returns more than one matching row for it, the values in the right table will be repeated for each distinct row on the left table. Query:- SQL>select e.eno,e.ename from employee e left outer join department d on e.eno=d.eno; Eno Ename Address Dno Dname Eno 1 Kiran Delhi D1 HR 1 2 Sita Banaras D2 IT 2 3 Amrit Mohali D4 Finance 3 4 Veeru Delhi D3 Sales 4
  • 15. Right Outer Join 1. A right outer join closely resembles a left outer join except with the treatment of the tables reserved. Every row from the “right table”. 2. B will appear in the joined table at least once. If no matching row from the ''left” table(A) exists, NULL will appear in cloumns from table A for those recprds that have no match in B. A right outer join returns all the values from the right table and matched values from the left table(NULL in case of no matching join predicate).
  • 16. Query:- SQL>select * from employee e right outer join department d on e.eno=d.eno; Eno Ename Address Dno Dname Eno 1 Kiran Delhi D1 HR 1 2 Sita Banaras D2 IT 2 4 Veeru Delhi D3 Sales 4 3 Amrit Mohali D4 Finance 3
  • 17. Full Outer Join 1. A full outer join combines the effect of applying both left and right outer joins. Where records in the full outer joined table that do not matched, the result set will have NULL values for every column of the table that have lacks matching row. For those records that do match, a single row will be produced in the result set(containing fields populated from both tables). 2. Select all records from table(A) and table(B) regardless of whether the join condition is meet or not.
  • 18. Query: SQL> select * from employee e full outer join department d on e.eno=d.eno; Eno Ename Address Dno Dname Eno 1 Kiran Delhi D1 HR 1 2 Sita Banaras D2 IT 2 4 Veeru Delhi D3 Sales 4 3 Amrit Mohali D4 Finance 3