January 28, 2025 |7.5K Views

    SQL | Join (Cartesian Join & Self Join)

      Share  1 Like
    Description
    Discussion

    CARTESIAN JOIN, also known as CROSS JOIN, combines each row from one table with every row from another table, resulting in a Cartesian product. This join does not require any specific condition between the tables, but in the presence of a WHERE condition, it behaves like an INNER JOIN. The result set size is the product of the rows in both tables, leading to potentially large datasets.

    SELF JOIN involves joining a table with itself, which is useful when comparing rows within the same table. In a SELF JOIN, table aliases are used to differentiate between the two instances of the same table, allowing comparison based on specific conditions. 

    For more details, please go through - SQL | Join (Cartesian Join & Self Join)