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!
=== Atoms === For the construction of the formulas we will assume an infinite set ''V'' of tuple variables. The formulas are defined given a database schema ''S'' = (''D'', ''R'', ''h'') and a partial function ''type'' : ''V'' βΈ 2<sup>''C''</sup>, called at ''type assignment'', that assigns headers to some tuple variables. We then define the ''set of [[atomic formula]]s'' ''A''[''S'',''type''] with the following rules: # if ''v'' and ''w'' in ''V'', ''a'' in ''type''(''v'') and ''b'' in ''type''(''w'') then the formula ''v''.''a'' = ''w''.''b'' is in ''A''[''S'',''type''], # if ''v'' in ''V'', ''a'' in ''type''(''v'') and ''k'' denotes a value in ''D'' then the formula ''v''.''a'' = ''k'' is in ''A''[''S'',''type''], and # if ''v'' in ''V'', ''r'' in ''R'' and ''type''(''v'') = ''h''(''r'') then the formula ''r''(''v'') is in ''A''[''S'',''type'']. Examples of atoms are: * (''t''.age = ''s''.age) β ''t'' has an age attribute and ''s'' has an age attribute with the same value * (''t''.name = "Codd") β tuple ''t'' has a name attribute and its value is "Codd" * Book(''t'') β tuple ''t'' is present in relation Book. The formal semantics of such atoms is defined given a database ''db'' over ''S'' and a tuple variable binding ''val'' : ''V'' β ''T''<sub>''D''</sub> that maps tuple variables to tuples over the domain in ''S'': # ''v''.''a'' = ''w''.''b'' is true if and only if ''val''(''v'')(''a'') = ''val''(''w'')(''b'') # ''v''.''a'' = ''k'' is true if and only if ''val''(''v'')(''a'') = ''k'' # ''r''(''v'') is true if and only if ''val''(''v'') is in ''db''(''r'')
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)