Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Example  





2 Mathematical properties  





3 Purpose  





4 See also  





5 References  














Relational calculus






Azərbaycanca
Deutsch
Español

Italiano

Русский
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


The relational calculus consists of two calculi, the tuple relational calculus and the domain relational calculus, that is part of the relational model for databases and provide a declarative way to specify database queries. The raison d'être of relational calculus is the formalization of query optimization, which is finding more efficient manners to execute the same query in a database.

The relational calculus is similar to the relational algebra, which is also part of the relational model: While the relational calculus is meant as a declarative language that prescribes no execution order on the subexpressions of a relational calculus expression, the relational algebra is meant as an imperative language: the sub-expressions of a relational algebraic expression are meant to be executed from left-to-right and inside-out following their nesting.

Per Codd's theorem, the relational algebra and the domain-independent relational calculus are logically equivalent.

Example[edit]

Arelational algebra expression might prescribe the following steps to retrieve the phone numbers and names of book stores that supply Some Sample Book:

  1. Join book stores and titles 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.

A relational calculus expression would formulate this query in the following descriptive or declarative manner:

Get StoreName and StorePhone for book stores such that there exists a title BK with the same BookstoreID value and with a BookTitle value of Some Sample Book.

Mathematical properties[edit]

The relational algebra and the domain-independent relational calculus are 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.

Purpose[edit]

The raison d'être of the relational calculus is the formalization of query optimization. Query optimization consists in determining from a query the most efficient manner (or manners) to execute it. Query optimization can be formalized as translating a relational calculus expression delivering an answer A into efficient relational algebraic expressions delivering the same answer A.

See also[edit]

References[edit]

  • t
  • e

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Relational_calculus&oldid=1220201722"

    Categories: 
    Database management systems
    Logical calculi
    Relational model
    Database stubs
    Hidden categories: 
    Articles with short description
    Short description matches Wikidata
    Articles lacking in-text citations from November 2021
    All articles lacking in-text citations
    Articles to be expanded from November 2021
    All articles to be expanded
    Articles using small message boxes
    All stub articles
     



    This page was last edited on 22 April 2024, at 11:59 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki