Difference between Relational Algebra and Relational Calculus

ProgrammingProgramming ScriptsSoftware & Coding

Relational Algebra

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 -

  • Select

  • Project

  • Union

  • Set different

  • Cartesian product

  • Rename

Relational Calculus

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.KeyRelational AlgebraRelational Calculus
1Language TypeRelational Algebra is procedural query language.Relational Calculus is a non-procedural or declarative query language.
2ObjectiveRelational Algebra targets how to obtain the result.Relational Calculus targets what result to obtain.
3OrderRelational Algebra specifies the order in which operations are to be performed.Relational Calculus specifies no such order of executions for its operations.
4DependencyRelational Algebra is domain independent.Relational Calculus can be domain dependent.
5Programming LanguageRelational Algebra is close to programming language concepts.Relational Calculus is not related to programming language concepts.
Updated on 16-May-2020 14:13:49