Dude has a lot of stuff on it, but this image I submitted as a comment will help you better.
Basically you have to understand the concept of left and right ( left e right
), for example:
Your table in FROM is its esquerda
table, that is, left
, when making a JOIN.
FROM tabela1 X
LEFT OUTER JOIN tabela2 Y ON Y.campo1 = X.campo2
That is, you are bringing everything from the X table, plus the Y records that have binding to the X.
Now in:
FROM tabela1 X
RIGHT OUTER JOIN tabela2 Y ON Y.campo1 = X.campo2
You put everything on your table of direita
"Y" plus those of "X" that have a relation with "Y".
The INNER only what is in common in the 2 tables, and the FULL back EVERYTHING independent of the relations.