The Relational Calculus
The Relational Calculus
A certain order is always explicitly specified in a relational algebra expression and a
strategy for evaluating the query is implied. In the relational calculus, there is no description
of how to evaluate a query; a relational calculus query specifies what is to be retrieved
rather than how to retrieve it.
The relational calculus is not related to differential and integral calculus in mathematics,
but takes its name from a branch of symbolic logic called predicate calculus. When
applied to databases, it is found in two forms: tuple relational calculus, as originally proposed
by Codd (1972a), and domain relational calculus, as proposed by Lacroix and
Pirotte (1977).
In first-order logic or predicate calculus, a predicate is a truth-valued function with
arguments. When we substitute values for the arguments, the function yields an expression,
called a proposition, which can be either true or false. For example, the sentences,
‘John White is a member of staff’ and ‘John White earns more than Ann Beech’ are both
propositions, since we can determine whether they are true or false. In the first case, we
have a function, ‘is a member of staff’, with one argument (John White); in the second
case, we have a function, ‘earns more than’, with two arguments (John White and Ann
Beech).
If a predicate contains a variable, as in ex is a member of stafff, there must be an associated
range for x. When we substitute some values of this range for x, the proposition may
be true; for other values, it may be false. For example, if the range is the set of all people
and we replace x by John White, the proposition eJohn White is a member of stafff is true.
If we replace x by the name of a person who is not a member of staff, the proposition is
false.
If P is a predicate, then we can write the set of all x such that P is true for x, as:
{x | P(x)}
We may connect predicates by the logical connectives È (AND), É (OR), and ~ (NOT) to
form compound predicates.
A certain order is always explicitly specified in a relational algebra expression and a
strategy for evaluating the query is implied. In the relational calculus, there is no description
of how to evaluate a query; a relational calculus query specifies what is to be retrieved
rather than how to retrieve it.
The relational calculus is not related to differential and integral calculus in mathematics,
but takes its name from a branch of symbolic logic called predicate calculus. When
applied to databases, it is found in two forms: tuple relational calculus, as originally proposed
by Codd (1972a), and domain relational calculus, as proposed by Lacroix and
Pirotte (1977).
In first-order logic or predicate calculus, a predicate is a truth-valued function with
arguments. When we substitute values for the arguments, the function yields an expression,
called a proposition, which can be either true or false. For example, the sentences,
‘John White is a member of staff’ and ‘John White earns more than Ann Beech’ are both
propositions, since we can determine whether they are true or false. In the first case, we
have a function, ‘is a member of staff’, with one argument (John White); in the second
case, we have a function, ‘earns more than’, with two arguments (John White and Ann
Beech).
If a predicate contains a variable, as in ex is a member of stafff, there must be an associated
range for x. When we substitute some values of this range for x, the proposition may
be true; for other values, it may be false. For example, if the range is the set of all people
and we replace x by John White, the proposition eJohn White is a member of stafff is true.
If we replace x by the name of a person who is not a member of staff, the proposition is
false.
If P is a predicate, then we can write the set of all x such that P is true for x, as:
{x | P(x)}
We may connect predicates by the logical connectives È (AND), É (OR), and ~ (NOT) to
form compound predicates.
The Relational Calculus
Reviewed by Shopping Sale
on
22:13
Rating:
No comments: