Relational Algebra

Introduction :- Relational algebra is a collection of operation to manipulate relational. It consist a set of operation that take one or more relations as input and produre new relation as their result. The relational algebra operations can be divided into basic set-oriented operation like union, difference, intersection, cartesion product, and relational-oriented operation like join, section, projection, division, etc.

Select :- A select operation is extracts specific tuples from a relation. We use the lower Greek letter sigma (σ) to denote selection consider the select operation to be a filter that keeps only these tuples that satisfy a qualifying condition.In general select operation is denoted by:

σ<Selection-condition><creation name>

Project :- A project operation is extrects attribute from a realtion. We use the project operation to project the relation over these attribute only. Project is denoted by Greek letter pi(π). The general form:

π<attribute list>(R)

Joins:- A join operation allows to combine two relational to form a single new relatiob. Join operation allows the processing of relation existing between the operanet relation. The general form:

π<employee. employee, name><employee ∞ Department, pact-no>

  • Equi join :- When two table joined together using equality of value in one or more columns. They make Equi join. The general form:

    R1<join condition>R2

  • Theta join :- Greek letter theta(θ) is one of the comparison operation(). Ajoin condition is called a theta join. The general form:

    R1∞<join condition>R2

  • Natural join :- The natural join also comparison operation is always the equality operator. But only Equi join containes two identical columns from the relation being joined. Equi join with one of the two identical columns eliminated is called a natural join.

Set operation

  • Set-union :- Union operation is denoted by symbol (∪). Duplicate tuples would be eliminated by using set-union.

    (R1∪R2)

  • Set-defference :- Set defference operation denoted by x.y allows to find tuple that are in one relation but or not in another relation.

    (R1-R2)

  • Set-intersection :- Intersection operation denoted by x ∩ y is operation that include all tuples that are in both x and y.

    (R1∩R2)

  • Set cartesion product :- Cartesian product is denoted by x×y and returne a relation on tuples whose schema contains all fields of x followed by fields of y.

    (R1×R2).