I realized how important it is to understand logical SQL query processing logic.
One example of how something totally new could be found by looking at this logic is what does actually logically happen, when two tables are joined with an OUTER join. OUTER join is actually just another logical step after "INNER join" logical step. This step adds rows, which do not satisfy ON predicate from left, right or both tables (latter - in case of FULL OUTER join).
As a result, in the following example, in the first case you could see rows, where city does not equal "Madrid" if corresponding customers don't have any orders (such customer records will simply be added after ON predicate checking):
In the second example, you are guaranteed to get only Madrid customer records.
One example of how something totally new could be found by looking at this logic is what does actually logically happen, when two tables are joined with an OUTER join. OUTER join is actually just another logical step after "INNER join" logical step. This step adds rows, which do not satisfy ON predicate from left, right or both tables (latter - in case of FULL OUTER join).
As a result, in the following example, in the first case you could see rows, where city does not equal "Madrid" if corresponding customers don't have any orders (such customer records will simply be added after ON predicate checking):
In the second example, you are guaranteed to get only Madrid customer records.
Comments