Last answered:

07 Sept 2022

Posted on:

02 Sept 2022

0

Resolved: CROSS JOIN vs. FULL OUTER JOIN

Hello,

I read that there is also a FULL OUTER JOIN in SQL, but the course doesn't have that in the lecture. So, is it the same with CROSS JOIN? If not, could you explain the difference between the two? Representing them in terms of Venn diagram would also help a lot.

Thanks,
Carl

1 answers ( 1 marked as helpful)
Instructor
Posted on:

07 Sept 2022

6

Hi Carl!
Thanks for reaching out.

A CROSS JOIN produces a cartesian product between the two tables, returning all possible combinations of all rows. It has no ON clause because you're just joining everything to everything.
A FULL OUTER JOIN is a combination of a LEFT OUTER and RIGHT OUTER JOIN. It returns all rows in both tables that match the query's WHERE clause, and in cases where the ON condition cannot be satisfied for those rows it puts NULL values for the unpopulated fields.

Hope this helps.
Best,
Tsvetelin

Submit an answer