Relational Operations


[Previous] [Table of Contents] [Next]

Select Operation

The select operation is used to select some specific records from the database based on some criteria.   This operation denoted as σ

σ <selection condition>(R)

Consider the relation PERSON.

Pic1

If you want to display details of persons having age less than or equal to 30 than the select operation will be used as follows:

σ <age<=30>(Person)

The resultant relation will be as follow:

Pic2

Project Operation

The project operation is used to select the records with specified attributes. This is denoted as Π.

Π List of attribute  for project (Relation)

Consider the relation PERSON.

Pic1

If you want to display only the names of persons then the project operation will be used as follows:

Π Name (PERSON)

The resultant relation will be as follows:

Pic3

Join Operation

Join operations bring together two relations and combine their attributes and tuples in a specific fashion.

Theta Join X

EMP X EMP.Dept = DEPART.Dept DEPART

The join condition can be  < = > ≥ ≤

When the join condition operator is = then we call this an Equijoin. Note that the attributes in common are repeated.

Natural Join 

In the generic (Theta) join operation, any attributes in common are repeated.  The Natural Join operation removes these duplicate attributes.

Division Operation

To perform the division operation R1÷R2, R2 should be a proper subset of R1. In the following example R1 contains attributes A and B and R2 contains only attribute B so R2 is a proper subset of R1. If we perform R1 R2 than the resultant relation will contain those values of A from R1 that are related to all values of B present in R2.

pic4