Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Relational calculus
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Theory of relational databases}} {{No footnotes|date=November 2021}} 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 [[logical equivalence|logically equivalent]]. == Example == A [[relational algebra]] expression might prescribe the following steps to retrieve the phone numbers and names of book stores that supply ''Some Sample Book'': # Join book stores and titles over the BookstoreID. # Restrict the result of that join to tuples for the book ''Some Sample Book''. # 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 == {{Expand section|date=November 2021}} The relational algebra and the domain-independent relational calculus are [[logical equivalence|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 == 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 == * [[Calculus of relations]] == References == * {{cite book | first=Christopher J. | last=Date | author-link=Christopher J. Date | year=2004 | title=An Introduction to Database Systems | url=https://archive.org/details/introductiontoda0000date | url-access=registration | edition=8th | publisher=Addison Wesley | isbn=0-321-19784-4 }} {{databases}} {{DEFAULTSORT:Relational Calculus}} [[Category:Logical calculi]] [[Category:Relational model]] [[Category:Database management systems]] {{database-stub}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Database-stub
(
edit
)
Template:Databases
(
edit
)
Template:Expand section
(
edit
)
Template:No footnotes
(
edit
)
Template:Short description
(
edit
)