Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Tuple relational calculus
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
=== Relational database === Since the calculus is a query language for [[relational database]]s we first have to define a relational database. The basic relational building block is the [[Data domain|domain]] (somewhat similar, but not equal to, a [[data type]]). A [[tuple]] is a finite sequence of [[Attribute (computing)|attribute]]s, which are [[ordered pair]]s of domains and values. A [[relational model|relation]] is a set of (compatible) tuples. Although these relational concepts are mathematically defined, those definitions map loosely to traditional database concepts. A [[table (database)|table]] is an accepted visual representation of a relation; a tuple is similar to the concept of a [[row (database)|row]]. We first assume the existence of a set ''C'' of column names, examples of which are "name", "author", "address", etcetera. We define ''headers'' as finite subsets of ''C''. A ''relational database schema'' is defined as a [[tuple]] ''S'' = (''D'', ''R'', ''h'') where ''D'' is the domain of atomic values (see [[relational model]] for more on the notions of ''domain'' and ''atomic value''), ''R'' is a finite set of relation names, and :''h'' : ''R'' β 2<sup>''C''</sup> a [[function (mathematics)|function]] that associates a header with each relation name in ''R''. (Note that this is a simplification from the full relational model where there is more than one domain and a header is not just a set of column names but also maps these column names to a domain.) Given a domain ''D'' we define a ''tuple'' over ''D'' as a [[partial function]] that maps some column names to an atomic value in ''D''. An example would be (name : "Harry", age : 25). :''t'' : ''C'' βΈ ''D'' The set of all tuples over ''D'' is denoted as ''T''<sub>''D''</sub>. The subset of ''C'' for which a tuple ''t'' is defined is called the ''domain'' of ''t'' (not to be confused with the domain in the schema) and denoted as ''dom''(''t''). Finally we define a ''relational database'' given a schema ''S'' = (''D'', ''R'', ''h'') as a function :''db'' : ''R'' β 2<sup>''T''<sub>''D''</sub></sup> that maps the relation names in ''R'' to finite subsets of ''T''<sub>''D''</sub>, such that for every relation name ''r'' in ''R'' and tuple ''t'' in ''db''(''r'') it holds that :''dom''(''t'') = ''h''(''r''). The latter requirement simply says that all the tuples in a relation should contain the same column names, namely those defined for it in the schema.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Tuple relational calculus
(section)
Add topic