RELATIONAL ALGEBRA:
Relational algebra collection of operations generate new relations after manipulating one or more existing relation. It is a procedural language with operations. It consists of a set of relations operations.Each operator has one or more relations as its input and produces a relation as it's output.Thus the output from one operation can become the input to another operation. This allows expressions to be nested in the relational algebra. This property is called relation are closed under the algebra.
The operations are based on two groups of logical entities are called operators. One group consists of the traditional set operator namely----UNION,INTERSECTIONS,DIFFERENCES,CARTESIAN PRODUCT, and the other group contains special or native relational operational operators, namely-----SELECTION,PROJECTION,JOIN,and DIVISION.
►UNION:
The union operator is denoted by symbol "U" or"+", and it acts on two real items to generate a new relations containing all tuple of the relations accept the duplicate once.This implied that the new relations will have tuple which will belong to either the first relation or the second or both.Thus the result of those operation denoted by "R"U"S", is a relation that includes all tuple those are either in "R" or in "S" or in "R&S". Duplicate tuple are eliminated.
To perform union operation on two relations,both operand and relation must be union compatible,which means that they must have same no. of columns drown from the same domain,i.e, must be of same data type.
Example:
Let "R" and "S" be the two relations as-------------
Thus RUS yields------
►INTERSECTIONS:
The intersection operator is denoted by the word intersect or the symbol "ᴖ" and it acts on another relation consisting of only the common tuple between the two.The result of this operation denoted by RᴖS include all tuple that are in both "R" and "S".
Example:
Let "R" and "S" be the two relations as-------------
RᴖS yields-----
ID STUDENT NAME
1. RAM
►DIFFERENCE:
The difference operator is denoted by the symbol "-";
and it operator on two relations to yield a third relation that comprise all tuples belonging to the relations. a difference operator can be achieved.
►CARTESIAN PRODUCT:
The extended Cartesian product of two relations is denoted by the operator "X", and it product a third relation containing all possible tuple that may be formed by concatenation the attributes of the relation.
Example:
Let "R" and "S" be the two relations as-------------
RELATION R RELATION S
Then "RXS" yields------
0 Comments
Post a Comment