A JOIN clause is used to combine rows from two or more tables, based on a related column between them.
If you want to access more than one table through a select statement.
If you want to combine two or more table then SQL JOIN statement is used .it combines rows of that tables in one table and one can retrieve the information by a SELECT statement.
The joining of two or more tables is based on common field between them.
SQL INNER JOIN also known as simple join is the most common type of join.
Here are the different types of the JOINs in SQL:
The INNER JOIN keyword selects records that have matching values in both tables.
The SQL left join returns all the values from the left table and it also includes matching values from right table, if there are no matching join value it returns NULL.
The SQL right join returns all the values from the rows of right table. It also includes the matched values from left table but if there is no matching in both tables, it returns NULL.
The FULL OUTER JOIN keyword return all records when there is a match in either left (table1) or right (table2) table records.
When each row of first table is combined with each row from the second table, known as Cartesian join or cross join. In general words we can say that SQL CROSS JOIN returns the Cartesian product of the sets of rows from the joined table.
We can specify a CROSS JOIN in two ways: