Hi there. There is this interesting infographic I found which relates set theory to table joins in SQL.

One can treat a database table as a set with elements being information within a table.

The set refers to table and the set refers to table .

__Left Join__

A left join selects everything from including the intersection . If the null part is TRUE then the intersection removed and the only part would be selected which is like .

__Right Join__

It would be similar with the right join with where the intersection is selected as well. If the null part is TRUE then the intersection removed and the only part would be selected which is like .

__Inner Join__

The SQL INNER JOIN portion of a query combined with select outputs the intersection of tables and .

__Full Outer Join__

The FULL OUTER JOIN portion of the query take everything from table , table and the intersection . If the key in table and the key in table IS NULL then the intersection is removed.

__References__

The featured image/infographic is from http://i.stack.imgur.com/UI25E.jpg.