JOIN SQL

Joins are used to select matching values from two tables.

Syntax:

        
            SELECT a.columnX, b.columnY
            FROM TableA a
            JOIN TableB b
            ON a.columnZ = b.columnT
        
    

There are four types of joins:

Note: A self join is a type of join where a table is joined with itself using the same syntax as for other joins (e.g., Inner Join, Left Join, Right Join, Full Join).

INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL JOIN
EXAMPLE