Difference between cross join and Full outer join - Sql server

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;
Purposes of OPENXML clause sql server stored procedure - Sql server
OPENXML clause - OPENXML parses the XML data in SQL Server in an efficient manner. It’s primary ability is to insert XML data to the RDB.........
What is the order in which the SQL query is executed? - Sql server
The following is the order of executing SQL query: The query goes to the shared pool that has information like parse tree and execution plan for the corresponding statement.......
How to store pdf file in sql server?
Store pdf file in sql server - Create a column as type ‘blob’ in a table. Read the content of the file and save in ‘blob’ type column in a table.......
Post your comment