SQL Joins

tags: #sql #public #sql-join

Inner join

Rows that have matches(eg left.id = right.id) in both left and right table are selected.

!SQL - Inner Join.png


Left Join (Aka, Left Outer Join)

All rows in left table are selected. If there are matches in right table they are joined.

!SQL - Left Join.png


Right Join(Aka, right outer Join)

All rows in the right table are selected. If there are matches in the left table they are joined.

!SQL - Right Join.png

Outer join (full join)

All rows in left and right tables are selected. If there are matches rows are joined. If there are no matches, the rows are still included while leaving the other side empty.

!SQL - Full Join.png

Backlinks