Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Relational calculus

Relational calculus

Overview
Relational calculus consists of two calculi, the tuple relational calculus
Tuple relational calculus
The tuple calculus is a calculus that was introduced by Edgar F. Codd as part of the relational model in order to give a declarative database query language for this data model...

 and the domain relational calculus
Domain relational calculus
In computer science, domain relational calculus is a calculus that was introduced by Michel Lacroix and Alain Pirotte as a declarative database query language for the relational data model.In DRC, queries have the form:...

, that are part of the relational model
Relational model
The relational model for database management is a database model based on first-order predicate logic, first formulated and proposed in 1969 by E.F. Codd.- Overview :...

 for databases and provide a declarative way to specify database queries. This in contrast to the relational algebra
Relational algebra
Relational algebra, an offshoot of first-order logic , deals with a set of finitary relations which is closed under certain operators. These operators operate on one or more relations to yield a relation...

 which is also part of the relational model but provides a more procedural way for specifying queries.

The relational algebra might suggest these steps to retrieve the phone numbers and names of book stores that supply Some Sample Book:
  1. Join books and book stores over the BookstoreID.
  2. Restrict the result of that join to tuples for the book Some Sample Book.
  3. Project the result of that restriction over StoreName and StorePhone.


The relational calculus would formulate a descriptive, declarative way:
Get StoreName and StorePhone for supplies such that there exists a title BK with the same BookstoreID value and with a BookTitle value of Some Sample Book.


The relational algebra and the relational calculus are essentially logically equivalent: for any algebraic expression, there is an equivalent expression in the calculus, and vice versa.
Discussion
Ask a question about 'Relational calculus'
Start a new discussion about 'Relational calculus'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
Relational calculus consists of two calculi, the tuple relational calculus
Tuple relational calculus
The tuple calculus is a calculus that was introduced by Edgar F. Codd as part of the relational model in order to give a declarative database query language for this data model...

 and the domain relational calculus
Domain relational calculus
In computer science, domain relational calculus is a calculus that was introduced by Michel Lacroix and Alain Pirotte as a declarative database query language for the relational data model.In DRC, queries have the form:...

, that are part of the relational model
Relational model
The relational model for database management is a database model based on first-order predicate logic, first formulated and proposed in 1969 by E.F. Codd.- Overview :...

 for databases and provide a declarative way to specify database queries. This in contrast to the relational algebra
Relational algebra
Relational algebra, an offshoot of first-order logic , deals with a set of finitary relations which is closed under certain operators. These operators operate on one or more relations to yield a relation...

 which is also part of the relational model but provides a more procedural way for specifying queries.

The relational algebra might suggest these steps to retrieve the phone numbers and names of book stores that supply Some Sample Book:
  1. Join books and book stores over the BookstoreID.
  2. Restrict the result of that join to tuples for the book Some Sample Book.
  3. Project the result of that restriction over StoreName and StorePhone.


The relational calculus would formulate a descriptive, declarative way:
Get StoreName and StorePhone for supplies such that there exists a title BK with the same BookstoreID value and with a BookTitle value of Some Sample Book.


The relational algebra and the relational calculus are essentially logically equivalent: for any algebraic expression, there is an equivalent expression in the calculus, and vice versa. This result is known as Codd's theorem
Codd's theorem
Codd's theorem states that relational algebra and the domain-independent relational calculus queries, two well-known foundational query languages for the relational model, are precisely equivalent in expressive power. That is, a database query can be formulated in one language if and only if it can...

.

See also

  • The Third Manifesto
    The Third Manifesto
    The Third Manifesto is Christopher J. Date's and Hugh Darwen's proposal for future database management systems, a response to two earlier Manifestos with the same purpose. The theme of the manifestos is how to avoid the 'object-relational impedance mismatch' between object-oriented programming...

  • Tutorial D
  • D (data language specification)
    D (data language specification)
    D is a set of requirements proposed by Christopher J. Date and Hugh Darwen in their book The Third Manifesto for what they believe a relational database query language ought to be like; D is not a language itself.- Overview :...

  • D4 (programming language)
    D4 (programming language)
    D4 is a computer language used in Dataphor, a relational database management system.-Syntax:Alphora, the creators of D4, have given it a Pascal like syntax...

     (an implementation of D)
  • Aldat Relational Algebra