- SQL JOINS are used to combine rows/records from different tables.
- Rows can be combined from either 2 tables or more than 2 tables as per our need using SQL JOINS. The result will be displayed as single table after combining.
Uses of SQL JOIN clause:
- Generally, SELECT SQL can select columns only from one table. But, with the help of SQL JOINS, SELECT SQL can select any columns from any table.
- SQL joining is possible between 2 tables when there is at least one common column available in those tables.
- SQL INNER JOIN is the most common join used for joining 2 tables. This type of join is also called as ‘simple join’.
There are different JOINS that can be performed in SQL. They are,
- SQL – Inner Join (Simple Join)
- SQL – Left Join (Left outer join)
- SQL – Right Join (Right outer join)
- SQL – Full Join (Full outer join)
- SQL – Self Join
- SQL – Cartesian Join or Cross join
SQL – Inner Join:
SQL – Left Join:
SQL – Right Join:
SQL – Full Join:
SQL – Self Join:
Table1 & Table2
SQL – Cartesian Join:
|Type of SQL JOINS||Description|
|SQL – Inner Join (Simple Join)||It is used to combine two or more tables together using the matching columns from both tables.|
|SQL – Left Join (Left outer join)||LEFT JOIN selects all records from left table and also selects all matching records from the right table.|
|SQL – Right Join (Right outer join)||RIGHT JOIN selects all records from right table and also selects all matching records from the left table.|
|SQL – Full Join (Full outer join)||FULL JOIN selects and returns all records from both left and right tables.|
|SQL – Self Join||Self Join is used to join a table to itself.|
|SQL – Cartesian Join or Cross Join||Cartesian Join returns the Cartesian products of 2 or more tables joined together.|