Expanding on

psydereal's explanations above...

Joins are a powerful part of relational algebra in database theory.

Cartesian Product (**R**_{1} × R_{2})

Technically, Cartesian Products are not considered true joins, but they are similar enough to warrant mentioning. The Cartesian product concatenates every tuple in the first relation with every tuple in the second relation. This includes illogical concatenations, limiting the usefulness of a raw Cartesian Product. However, the Cartesian Product is the primitive from which more useful joins are born.

Theta join (**R**_{1} |X|_{predicate} R_{2})

The tuples in a Cartesian product of two relations satisfying some predicate making use of any comparison sign (= ≠ < > ≤ ≥). This is the type of join that is signified with the bow tie shape that cannot currently be represented in HTML.

*Example:*
**NoderInfo |X|**_{NoderInfo.XP < NoderWriteups.totalRep} NoderWriteups

*
would give you all the NoderInfo and NoderWriteups table information for noders with less XP than the sum total of their writeup reputations.*

Equijoin
An equijoin of a special case of the Theta join where the only comparison used in the predicate is =.

Natural join (**R**_{1} |X| R_{2})

A natural join is a special case of the Equijoin, where the two relations already have at least one field in common. The relations are joined, and redundant fields are ignored. Because a natural join means that there are common fields, the predicate is not explicitly stated, unlike other Theta joins.

Outer join (**R**_{1} ]X| R_{2})

Tuples from R_{1} that do not have matching values in the common attributes of R_{2} are also included in the result of the join. Missing values in the second relation are set to null.

*Example:*
**NoderInfo ]X| NoderWriteups**

*
would give you a list of all NoderInfo and all NoderWriteups for all noders, even if they haven't written any writeups yet.*

Technically ]X| (looking sort of like a bowtie with flags on it) is a left, or natural, outer join, but |X[ and ]X[ can also be used, called a right outer join and full outer join, respectively.

Semijoin (**R**_{1} |>_{predicate} R_{2})

A join containing the tuples of R_{1} that would be used in a theta join with R_{2}. This can be rewritten as the projection of all attributes A in R_{1} of the theta join of the two relations:

**π**_{A}(R_{1} |X|_{predicate} R_{2})

*Example:*
**NoderInfo |>**_{NoderInfo.XP < NoderWriteups.totalRep} NoderWriteups

*
would only give you NoderInfo for noders with less XP than the sum total of their writeup reputations.*

As you can see, the semijoin symbol looks like an arrowhead pointing at the second relation, or half a bowtie.