There areย fiveย types of JOIN, defined byย ANSI standard SQLโ
Sr. | JOIN TYPES | USAGE |
1 | INNER JOIN | Returns records that have matching values in both tables |
2 | LEFT OUTER JOIN | Returns all records from left table and matching records from right table |
3 | RIGHT OUTER JOIN | Returns all records from right table, and matching records from the left table |
4 | FULL OUTER JOIN | Returns all records when there is a match in either left or right table |
5 | CROSS JOIN | Returns combinations of each row of the first table with the each row from second table. |
Syntax for INNER JOIN,LEFT JOIN,RIGHT JOIN,FULL OUTER JOIN-
SELECTย <column_name(s)>
FROMย <table1>
[INNER JOIN|LEFT JOIN|RIGHT JOIN|FULL OUTER JOIN]<table2>
ONย <table1.column_name=table2.column_name>
WHERE<condition>;
Syntax for CROSS JOIN-
SELECTย <column_name(s)>
FROMย <table1>
CROSS JOIN<table2>;
Saraswat World Changed status to publish June 8, 2023
Leave a Reply