What is mean by Full Outer Join examples?

  • Full Outer Join | Cartesian Join-

The Full Outer Join and Cartisian joins are less used joins in day to day applications, reporting ,web applications. These joins are less used because it deals with all the data from left table as well as right table. So if we want all the records from both left and right table we will directly use table no need to use the joins.

CLICK HERE TO GET INFORMATION ON INNER JOIN AND OUTER JOIN

  • Full Outer Join:

When 2 tables are connected with each other such that it should take all records from left table as well as right table and only matching record from both the tables then this join is called as Full Outer Join. This join is less used join in applications.

Full outer join is one of the less used join in day to day applications

  • Syntax:

Select t1.col1,t2.col2….t ‘n’col ‘n.’.

from table1 t1 full join table2 t2

on t1.col=t2.col;

  • Real Life Scenario:
  • Question: What is the query to display the all departments with its Employee name allocation?

    Consider there are 2 tables. Employee table which has following columns:

    Employee_num Employee_name Department ID Salary
    1 Amit 100 680000
    2 Rohan 100 550000
    3 Rohit 101 430000

    There is another table called as Depatment which has following structure:

    Department ID Department Name
    100 OBIEE
    101 Oracle PLSQL
    102 COGNOS
    • SQL Query:

    Select a.Department_ID,b.Employee_Name from

    Employee b full outer join Department a

    on a.Department_ID=b.Department_ID;

    Output :

    Department ID Department Name
    100 Amit
    100 Rohan
    101 Rohit
    102 Null

    We have used the Full Outer join here because we need to show all the records from all the Tables.

    Cartesian Join:

    This join is very less used join in day to day application. Developers have strict instructions that join should not be Cartesian product. Because if we use this join then each and every record from first table will join to each and every record of second table. When we are not giving any joining condition then it displays Cartesian product.

    Hope You get the idea about Full outer join and cartesian join in SQL.

    HOME

Amit S

Oracle Consultant with vast experience in Oracle BI and PL/SQL Development. Amiet is the admin head of this website who contributes by preparing tutorials and articles related to database technologies. He is responsible to manage the content and front-end of the website.

Recent Posts

What is Root Cause Analysis (RCA) With real examples

In my previous article I have given details about application support engineer day to day…

1 week ago

Application Support Engineer Day to day responsibilities

In my previous articles I have given the roles and responsibilities of L1,L2 and L3…

2 weeks ago

What is mean by SLA ( Service Level Agreement) with Examples?

In my previous articles i have given the hierarchy of production support in real company…

2 weeks ago

What is Production support Hierarchy in organization?

In this article i would like to provide information about production support organization structure or…

2 weeks ago

What are roles and responsibilities for L3 Support Engineer?

In my previous article I have given roles for L1 and L2 support engineer with…

2 weeks ago

What are roles and responsibilities of L2 Engineer?

I have started this new series of how to become application support engineer. This article…

2 weeks ago