Relational algebra is a procedural query language, which takes instances of relations as input and yields instances of relations as output. It uses operators to perform queries. An operator can be either unary or binary. They accept relations as their input and yield relations as their output. Relational algebra is performed recursively on a relation and intermediate results are also considered relations.
The fundamental operations of relational algebra are as follows -
In contrast to Relational Algebra, Relational Calculus is a non-procedural query language, that is, it tells what to do but never explains how to do it.
Relational calculus exists in two forms -
Tuple Relational Calculus (TRC)
Domain Relational Calculus (DRC)
Following are some of the important differences between Relational Algebra and Relational Calculus.
|Sr. No.||Key||Relational Algebra||Relational Calculus|
|1||Language Type||Relational Algebra is procedural query language.||Relational Calculus is a non-procedural or declarative query language.|
|2||Objective||Relational Algebra targets how to obtain the result.||Relational Calculus targets what result to obtain.|
|3||Order||Relational Algebra specifies the order in which operations are to be performed.||Relational Calculus specifies no such order of executions for its operations.|
|4||Dependency||Relational Algebra is domain independent.||Relational Calculus can be domain dependent.|
|5||Programming Language||Relational Algebra is close to programming language concepts.||Relational Calculus is not related to programming language concepts.|