Relation Algebra
Relational Algebra
A relational algebra operates on relations, as it is relational algebra is a procedural query language based on a small number of operators. It acts as an intermediate language used by a RDBMS. By applying special operators to relations, queries are made.
There are six fundamental operations select, project, rename, Cartesian product, union, set-difference. Out of these six select, project, rename are unary and rest are binary, i.e., cartesian product, union, set- difference.
Several other operations are also there which are defined in terms of the fundamental operations, viz., set-intersection, natural join, division, assignment.
A basic expression consists of either
• A relation in the database.
• A constant relation.
General expressions are formed out of smaller sub-expressions using
• σq(E1) select (q a predicate)
• Пz(E1) project (z a list of attributes)
• ρx(E1) rename (x a relation name)
• E1 U E2 union
• E1 - E2 set difference
• E1 * E2 cartesian product
Posted in Computer Science, Information Technology, DBMS, DBMS |
