contador Saltar al contenido

Difference between relational algebra and relational calculation

Relational algebra and relational computation are the formal query languages ??for a relational model. Both form the basis for the SQL language that is used in most relational DBMSs. Relational algebra a procedural language. On the other hand, the relational calculation a declarative language. Relational algebra and relational calculation can be further differentiated on many aspects, which I discussed below with the help of the comparison table.

Content: Relational algebra. Relational calculation

  1. Comparative graph
  2. Definition
  3. Key differences
  4. Conclusion

Comparative graph

Basis for comparisonRelational algebraRelational calculation
Basic Relational algebra a procedural language. Claculus relational the declarative language.
States Relational algebra indicates how to obtain the result. The relational calculation indicates what result we must obtain.
Order Relational algebra describes the order in which operations are to be performed. The relational calculation does not specify the order of operations.
Domain Relational algebra does not depend on the domain. The Claculus relationship can be domain dependent.
reported near a programming language. near the natural tongue.

Definition of Relational Algebra

Relational algebra presents the basic set of operations for the relational model. a language procedural, which describes the procedure for obtaining the result. The prescriptive relational algebra because it describes the order of operations in the query it specifies such as retrieve the result of a query.

The sequence of operations in an algebra of the relations called expression of relational algebra. The expression Relational algebra takes a relation or two relations as input to the expression and produces a new relationship as a result. The resulting relation obtained from the expressions of relational algebra can be further composed by the other expression of relational algebra whose result will again be a new relationship.

Relation Algebra is the framework for the implementation and optimization of queries during query processing. Relational algebra is an integral part of the relational DBMS. The fundamental operations included in the relational algebra are { Select (), Project (), Union (), Set Difference (-), Cartesian product () and Rename () }.

Definition of relational calculation

Unlike relational algebra, relational calculus is a language declarative of upper level. In opposition to relational algebra, the relational calculation defines which result must be obtained. As relational algebra, relational calculus does not specify the sequence of operations in which the query will be evaluated.

The sequence of the relational calculation operations called expression of relational calculation which also produces a new relationship as a result. The relational calculation has two variants: Tuple Relational Calculus is Domain Relational Calculus .

The relational calculation of the tuple list the tuples to select from a report, based on a specific one condition provided. formally referred to as:

P (t)

Where is it t the set of tuples for which the condition P true.

The next variant is the relational calculation of the domain, which contrary to the relational calculation of the tuple list the attributes to select from a report, based on certain conditions . The formal definition of Domain Relational Calculus is as follows:

Where is it X1, X2, X3,. . . Xn are the attributes and P the certain condition.

Key differences between relational algebra and relational calculus

  1. The fundamental difference between relational algebra and relational calculation that relational algebra is a procedural language, whereas relational computation is a non-procedural one, instead a declarative language.
  2. Relational algebra defines how to obtain the result, while the relational calculation defines what information must contain the result.
  3. Relational algebra specifies the sequence in which the operations in the query must be performed. On the other hand, the relational calculation does not specify the sequence of operations to be performed in the query.
  4. The relational algebra does not depend on the domain, whereas the relational calculation can be dependent on the domain as we have the relational calculation of the domain.
  5. The query language Relational algebra closely related to the programming language whereas, the relational calculation is closely related to natural language.

Conclusion:

Relational algebra and relational calculus both have an equivalent expressive power. The main difference between them that relational algebra specifies how to recover data and the relational calculation defines which data must be recovered.