Difference between cross join and Full outer join.
Cross Join:- It produces the Cartesian product.
- Results in Cartesian product of two tables.
- Results in pairs of rows.
- No join conditions are specified.
Syntax:SELECT * FROM table1
CROSS JOIN table2;
Example:SELECT * FROM employee
CROSS JOIN department;
Full Outer Join:- It includes all the rows from both the tables.
- Assigns NULL for unmatched fields.
- Results in every row from both of the tables , at least once.
- A combination of both left and right outer joins.
Syntax:SELECT column1, column2
FROM table1
FULL OUTER JOIN table2
ON table1.column1 = table2.column1;
Example:SELECT empId, empName
FROM employee
FULL OUTER JOIN department
ON employee.empId = department.empId
ORDER BY employee.empName;