SQL Cross Join & Outer Join

Jordan
2 min readOct 24, 2022

--

Cross join and outer join are both SQL join expression styles. A cross join performs a relational product of two tables. The syntax is SELECT column-list FROM table1 CROSS JOIN table2, with an example being SELECT * FROM INVOICE CROSS JOIN LINE; (Coronel & Morris, 2017).

Join operations can be classified as inner joins and outer joins. The inner join is the traditional join in which only rows that meet a given criterion are selected. The join criterion can be an equality condition. An out join returns not only the matching rows but the rows with unmatched attribute values for one table or both tables to be joined (Coronel & Morris, 2017).

There are three join types within the outer join classification. The first join type is the left join. Left join returns rows with matching values and includes all rows form the left table with unmated values. The second join type is right join. Right join returns rows with matching values and includes all rows from the right table with unmatched values. The third join type is full join. Full join returns rows with matching values and includes all rows from both tables with unmatched values (Coronel & Morris, 2017).

References

Coronal, C. & Morris, S. (2017). Database Systems: Design, Implementation, and Management.

Cengage Learning.

--

--