Types of Joins in SQL


42
views
0
3 months ago by
What is the difference between these types of joins in SQL?

join
left join
inner join
right join
outer join
full outer join
cross join
Community: Zimmer Biomet

1 Answer


0
3 months ago by
JOIN/INNER JOIN: Returns all records that are shared between two tables.
OUTER JOIN/FULL OUTER JOIN:  Returns everything the inner join does as well as any unmatched records from both the left and right table.
LEFT JOIN: Returns all records from the left table, regardless of matches in the right table. (right table being the table you are joining to the left table)
RIGHT JOIN: Returns all records from the right table, regardless of matches in the left table. (right table being the table you are joining to the left table)
CROSS JOIN: Each row in the left table is matched to every row in the right table. This will cause what is known as a Cartesian join and you will end up with lots of duplicate records.
Please login to add an answer/comment or follow this question.

Similar posts:
Search »