The Join clause is used to join rows from two or more tables together based on a common column. There are several sorts of joins that may be used to obtain data, depending on the tables’ relationships.
There are four different kinds of joins:
- Inner Join: Inner Join basically returns records that have matching values in both tables.
- Left Join: Left Join returns rows that are common between the tables and all the rows of the left-hand-side table, i.e., it returns all the rows from the left-hand-side table even if there are no matches available in the right-hand-side table.
- Right Join: Right Join returns rows that are common between the tables and all the rows of the right-hand-side table, i.e., it returns all the rows from the right-hand-side table even if there are no matches available in the left-hand-side table.
- Full Join: Full Join returns all the rows from the left-hand-side table and all the rows from the right-hand-side table.