Database Reference
In-Depth Information
This projection is given by the following logical equivalence
r(x i 1 ,...,x i k )
⇔∃
x j 1 ...x j n r 1 (x 1 ,...,x ar(r 1 ) ),
where n =
ar(r 1 ) k and for all 1
m n , j m / ∈{ i 1 ,...,i k }
, so that
r =
.
4. Selection is a unary operation written as _ WHERE C , where a condition C
is a finite-l e ngth logical formula that consists of atoms ' (name i θ nam e j ) 'or
' (name i θ d) ', with built-in predicates θ Σ θ ⊇{
x j 1 ...x j n r 1 (x 1 ,...,x ar(r 1 ) )
.
= ,>,< }
, a constant d , and
the logical operators
(NOT), such that for a relation r 1
and name i , name j the names of its columns, we define the relation r by
r 1 WHERE C,
(AND),
(OR) and
¬
=
as the relation with atr(r)
atr(r 1 ) and the function nr r equal to nr r 1 , where
r
for which C is satisfied.
This selection is given by the following logical equivalence:
is composed by the tuples in
r 1
r 1 (x 1 ,...,x ar(r 1 ) )
C( x ) ,
r(x i 1 ,...,x i k )
where C( x ) is obtained by substitution of each name i =
nr r 1 (j) (of the j th col-
umn of r 1 ) in the formula C by the variable x j , so that
r = r 1 (x 1 ,...,x ar(r 1 ) ) C( x ) .
4.1. We assume as an iden ti ty un ary operation , the operation _ WHERE C when
C is the atomic condition 1 .
1 (i.e., a tautology).
5. Union is a binary operation written as _ UNION _ such that for two union-
compatible relations r 1 and r 2 , we define the relation r by: r 1 UNION r 2 , where
=
r
r 1
r 2
, with atr(r)
=
atr(r 1 ) , and the functions atr r =
atr r 1 , and
nr r =
nr r 1 . This union is given by the following logical equivalence:
r(x 1 ,...,x n )
r 1 (x 1 ,...,x n )
r 2 (x 1 ,...,x n ) ,
where n
=
ar(r)
=
ar(r 1 )
=
ar(r 2 ) , so that
r 2 (x 1 ,...,x n ) .
6. Set difference is a binary operation written as _ MINUS_ such that for two union-
compatible relations r 1 and r 2 , we define the relation r by r 1 MINUS r 2 , where
= r 1 (x 1 ,...,x n )
r
r
{
t
|
t
r 1
such that t /
r 2 }
, with atr(r)
=
atr(r 1 ) , and the functions
atr r =
nr r 1 .
Let r 1 and r 2 be the predicates (relational symbols) for these two relations.
Then their difference is given by the following logical equivalence:
r(x 1 ,...,x n ) r 1 (x 1 ,...,x n ) ∧¬ r 2 (x 1 ,...,x n ) ,
atr r 1 , and nr r =
=
=
=
where n
ar(r)
ar(r 1 )
ar(r 2 ) , and hence
r 1 (x 1 ,...,x n )
r 2 (x 1 ,...,x n ) .
r
=
∧¬
Search WWH ::




Custom Search