SQLxD Part 11 — JOINs

This is the eleventh part of the SQLxD series. For your convenience you can find other parts in the table of contents in Part 1 – XML Transformation

Today we implement various JOIN operators. Let’s start with interfaces:

Let’s start with the simplest join — CROSS JOIN:

We simply implement nested loop algorithm and add cells from both of the rows.

The INNER JOIN is CROSS JOIN + WHERE:

And we are good to go. Now outer joins:

Each OUTER JOIN is INNER JOIN + some missing rows which we add manually. That’s all.