Database Reference
In-Depth Information
the construction of f(t RA ) is defined by the following composition of schema map-
pings:
M AB k = M B k B k 1 ◦···◦ M B 1 B 0 M A 1 B 0 M AA 1 : A B k .
(5.5)
Thus, we have the following two cases:
1. If this term t R Σ T RE is an updating of a relation r A
then it can be equiv-
alently represented by the schema mapping
M B k A M AB k : A A
, where
M B k A ={
Ψ
}: B k A
with Ψ equal to the SOtgd
x (r t k ( x )
r( x )) .
2. Otherwise, t R is an SPJRU term of a view over
A
and hence it can be rep-
resented by the schema mapping
M A 2 A M B k A 2 M AB k : A A
, where
A 2 =
(S A ∪{
r t k }
A ) (i.e., the extension of
A
by a relational symbol for
this view),
M B k A 2 ={
Φ 1 }
with Φ 1 equal to SOtgd
x (r t k ( x )
r t k ( x )) , and
where Φ 2 is equal to the SOtgd r S A
M A 2 A ={ Φ 2 }
x (r( x ) r( x )) .
Thus, each update of a given database, or the extraction of its views, may be
specified as a particular schema mapping. The evaluation functor Eval
:
DB
formally expresses the semantics of the terms (i.e., their evaluation) of the Σ RA
algebra and, from the fact that all (also the update) terms of the Codd's algebra may
be equivalently represented by the terms of the Σ RA algebra, we conclude that the
DB category is a powerful denotational semantics not only for the database schema
mappings (based on SPJRU subalgebra of the Σ R Codd's algebra) but also for the
database updates.
RA
Corollary 17
, each update of its relations in a
current instance A can be expressed in DB by a morphism f
For any given database schema
A
:
A
A 1 , where A 1
is the resulting database of the schema
A
after these updates .
Proof It is a consequence of the reduction to the inter-schema mappings in Propo-
sition 26 . We have shown in the previous Example 34 that for all three basic kinds
of the data manipulation (of the relations of a given instance A
α (
) ), which
are UPDATE, INSERT or DELETE, they are expressed in DB by a morphism
f
=
A
α (
α 1 (
f D in (iii), in Ex-
ample 34 ), where A 1 = α 1 ( A ) is the database instance after such updates.
Consequently, any data manipulation of the relations of a given instance A of
database schema
:
A
)
A
) ( f
=
f U in (i), f
=
f I in (ii) and f
=
is a combination of these three basic kinds of data manipulations
and hence a composition of these basic morphisms above, which is a morphism from
A into the final obtained database instance of this schema
A
A
(after all updates).
Based on this corollary, the whole collection of all the data manipulations of
a given database schema
is represented as a composition of morphisms from the
empty database instance A 0 , with all empty relations (immediately after the creation
of RDB schema of this database), into the final (current) instance of this database.
This 'completeness property' of the DB category, w.r.t. the full Codd's algebra,
both with updating of the relational tables of the instance databases (with inserting
and deleting, expressed in Example 34 by the morphisms in DB category), will be
A
Search WWH ::




Custom Search