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 .
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 .
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 .
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.
The featured image/infographic is from http://i.stack.imgur.com/UI25E.jpg.