Database Reference
In-Depth Information
UPDATE
r
SET
nr
r
(i
1
)
e
i
k
WHERE
C,
=
e
i
1
,...,nr
r
(i
k
)
=
where 1
ar(r)
.
This update of the extension of
r
will produce a new database instance of
≤
k
≤
n
=
A
,
α
1
(
equal to
A
1
=
A
)
such that for each relational symbol
r
A
in
A
but different
from
r
,
α
1
(r
A
)
=
α(r
A
)
.
As we have seen (point 3 for the update operators in Sect.
5.1
), this update
operation can be expressed by operations in
Σ
RE
algebra (in Definition
31
)
and hence we obtain the following tree-term,
C)
UNION
EXTEND
...
EXTEND
(r
WHERE
C)
ADD
atr
r
(
1
), name
1
AS
e
1
...
ADD
atr
r
(n), name
n
AS
e
n
[
(r
WHERE
¬
S
]
,
where for each 1
≤
m
≤
n
,if
m
∈{
i
1
,...,i
k
}
then
e
m
=
nr
r
(m)
, and
S
=
. This term is represented in the diagram (tree) above.
Now we will transform this term into an equivalent
Σ
RA
term, by substi-
tuting the operators 'UNION' with the equivalent composition of operators in
Σ
RA
, as specified in the proof of Proposition
20
.
So, the final part of the right-path of this term, EXTEND (
r
WHERE
C
)
ADD
atr
r
(
1
), name
1
AS
e
1
can be reduced (by the algorithm in the proof of
Proposition
23
) into the path-term
(r
name
1
,...,name
n
atr
r
(
1
), name
1
,e
1
)
WHERE
C
.
By repeating this process to all 'EXTEND...' operations in the right-path
of the tree-term in the figure above, we obtain an equivalent path-term of
Σ
RA
algebra
(t
RA
WHERE
C)
∈
T
RA
X
is recur-
t
(n)
[
S
]
, where the leaf term
t
RA
=
sively defined by:
t
(i
−
1
)
atr
r
(i), name
i
,e
i
for
i
t
(i)
1
,
2
,...,n
and
t
(
0
)
=
=
=
r.
By substitution of the
Σ
RE
operation 'UNION' with the corresponding compo-
sition of operations in
Σ
RA
, the original tree-term in the figure above is reduced
to the following
Σ
RA
tree-term:
(r
WHERE
C)
TIMES
(t
RA
WHERE
C)
]
REDUCE
S
TO
S
1
,
¬
[
S
represented by the second diagram bellow (where
S
1
=
nr(r)
=
nr
r
(
1
),
...,nr
r
(n)
).