For example, consider the scheme below:
CROSSJOIN
Whenwewanttojointwoormoretablesbycrossing.Thatis,foreachrowoftheFUNCTIONALtablewewantalltheCHARGESorviceversa.
INNERJOIN
Whenwewanttojointwoormoretablesbycoincidence.ForeachrowoftheFUNCINARYtablewewantthecorrespondingPOSITIONthatinternally(INNER),intheirattributevalues,match.InthecaseofFUNIONARYandCHARGEthematchinginternalattributesarecodeIngintheTABLEtableandcodeIngintheFUNCTIONALtable.Tocombinethetwotables,itwillbenecessarytoconnectthetwotablesbytheirmatchinginternalattributes(INNER).
LEFTOUTERJOIN
LookingattheFUNCTIONALtable,supposethattheemployeeTadeuhasnopositionassociatedwithit.Ifwewishtolistalltheemployeeswiththeirrespectivepositions,includingtheemployeeswithoutpositions,wecoulduseallthepoweroftheINNERJOINjunctionbyaddingOUTER(OUTS/OUTS)EmployeeswhoarenotpartofINNERJOIN,justtothosewithoutpositionslikeTadeu.WecanachievethisbyjoiningFUNCIONARIO/CARGOthroughthedeclarationOUTERLEFTJOINCARGO,whichpromotestheinternaljoining(INNER)ofallemployeestopositionsandlistsother(OUTSOURDED/OUTER)nonassociated.
Animportantobservationisthattheorderoftheconnection(ON)makesnodifference,ie:"ON (F.codCargo = C.codCargo)" is exactly equal to "ON (C.codCargo = F.codCargo)"
RIGHTOUTERJOIN
LookingattheCARGOtable,supposethemanagerposition,withcodeC3,isnotreferenced/associatedby/toanyemployeeintheOFFICIALtable.IfwewishtolistallCHARGESandtheirrespectiveOFFICERS,includingCHARGESwithoutEMPLOYEES,wecouldusetheRIGTHOUTERJOINjoin.
OUTERFULLJOIN
Herewecombinethepowerofinternaljoins(INNER),thelistingofallothernon-associatedlines,bothontherightside(RIGHT)ofthejunctionandontheLEFTside.
@ reference