1.

State difference between Full Join and Cross Join.

Answer»

  • Cross Join: A Cross Join is also referred to as a Cartesian join or Cartesian product. The result set of a cross join is equal to all of the rows from the first table multiplied by all of the rows from the second table. It applies to all columns.

Syntax:

SELECT * FROM Table_1 CROSS JOIN Table_2;

In the case of two lists, one consisting of 4, 5, 6, and the other consisting of a, b, and c, the Cartesian product between the two lists would be as follows:

4a, 5b, 6c

4a, 5b, 6c

4a, 5b, 6c


  • Full Join: This is also referred to as a full outer join. In a full outer join, all rows of tables are combined to form a result set. It basically means that a query would return a result set from both tables, even if they had NULL values. A result-set (joined table) will display NULL values if both tables do not contain any matching rows.

Syntax:

SELECT * FROM Table1 FULL OUTER JOIN Table2 ON Table1.column_name = Table2.column_name;


Discussion

No Comment Found