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
Tuple relational calculus
(section)
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!
=== Domain-independent queries === Because the semantics of the quantifiers is such that they quantify over all the tuples over the domain in the schema it can be that a query may return a different result for a certain database if another schema is presumed. For example, consider the two schemas ''S<sub>1</sub>'' = ( ''D<sub>1</sub>'', ''R'', ''h'' ) and ''S<sub>2</sub>'' = ( ''D<sub>2</sub>'', ''R'', ''h'' ) with domains ''D<sub>1</sub>'' = { 1 }, ''D<sub>2</sub>'' = { 1, 2 }, relation names ''R'' = { "r<sub>1</sub>" } and headers ''h'' = { ("r<sub>1</sub>", {"a"}) }. Both schemas have a common instance: : ''db'' = { ( "r<sub>1</sub>", { ("a", 1) } ) } If we consider the following query expression : { ''t'' : {a} | ''t''.a = ''t''.a } then its result on ''db'' is either { (a : 1) } under ''S<sub>1</sub>'' or { (a : 1), (a : 2) } under ''S<sub>2</sub>''. It will also be clear that if we take the domain to be an infinite set, then the result of the query will also be infinite. To solve these problems we will restrict our attention to those queries that are ''domain independent'', i.e., the queries that return the same result for a database under all of its schemas. An interesting property of these queries is that if we assume that the tuple variables range over tuples over the so-called ''active domain'' of the database, which is the subset of the domain that occurs in at least one tuple in the database or in the query expression, then the semantics of the query expressions does not change. In fact, in many definitions of the tuple calculus this is how the semantics of the quantifiers is defined, which makes all queries by definition domain independent.
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)