The JOIN operation denoted by �?? is used to combine related tuples from two relations into single tuples. This operation is very important for any relational database with more than a single relation because it allows us to process relationships among relations.
A Complete Set Of Relational Algebra Operations
It has been shown that the set of relational algebra operation is a complete set. Any of the other relational algebra operations can be expressed as a sequence of operations from this set. For example, the INTERSECTION operation can be expressed by UNION and DIFFERENCE as follows:
Although, strictly speaking, INTERSECTION is not required, it is inconvenient to specify this complex expression every time we wish to specify an intersection. As another example, a JOIN operation can be specified as a CARTSIAN PRODUCT followed by a SELECT operation as we discussed:
Similarly, a NATURAL JOIN can be specified as a CARTESIAN PRODUCT proceeded by RENAME and followed by SELECT and PROJECT operations. Hence, the various JOIN operations are also not strictly necessary for the expressive power of the relational algebra.They are very important because they are convenient to use and are commonly applied in database applications.
The DIVISION operation is useful for a special kind of query that sometimes occurs in database applications. An example is ?retrieve the names of employee who work on all the project that ?Daniel Olayinka works on?. To express this query using the DIVISION operation, the intermediate relation Daniel_PNOS:
Next, create a relation that includes a tuple Whenever the employee whose social security number is ESSN works on the project whose number is PNO in the intermediate relation SSN ? PNOS
Finally, apply the DIVISION operation to the two relations, which gives the desired employee social security numbers