Loading, please wait...

Cartesian Join

How To Use Cartesian Join In SQL

Introduction:
In this article, you will learn, what Cartesian Join is and how to use Cartesian Join in SQL.

Cartesian Join works on the product of rows for one or more tables. Cartesian Join is also known as Cross join. This join depends on the two main conditions:

  • If our join situation is constantly true.
  • The join situation is missing from the report.

 

Here, we have two tables-

 

Employee Table

 

 

 

Query Table

 

 

 

Now, we collect same records in both the tables, according to our condition.

 

Syntax

The syntax of Cartesian Join is as follows:

select table1.column1, table2.column2... from table1, table2 [ table3 ]

 

Example

Step 1: We write our query for Cartesian Join.

 

 

 

Now, select and execute this query.

 

Step 2: The output of this query is-

 

 

 

Summary:
Thus, we learned, Cartesian Join shows the product of rows from the tables.