Database Reference
In-Depth Information
•
60.) A business rule is a
statement that defines or constrains some aspect of the business. It is intended to
assert business structure or to control or influence the behavior of the business.
A typical example of the entity integrity is the primary-key integrity constraint for
relational database relations, and it can be expressed in the FOL by egds. A typi-
cal example of the referential integrity is the foreign-key integrity constraint (FK)
between relations in a give database, an it can be expressed in the FOL by tgds.
The domain integrity for a given attribute
a
∈
User Defined Integrity. (For example,
Age
≥
18
∧
Age
≤
att
is defined by
dom(a)
⊂
U
in
the introduction (Sect.
1.4
).
Each user-defined integrity of a given relation
r
with attribute-variables in
x
,ex-
pressed by a formula
ψ(
x
)
by using the build-in predicates
.
=
,
=
,<,...
(Extensions
of FOL, Sect.
1.3.1
), can be defined as a tgd
r(
x
)
ψ(
x
)
.
Consequently, we need only to consider two kinds of transformations, from the
egds into a SOtgd and from the tgds into a SOtgd.
Such transformations of the integrity constraints into an SOtgd have to define a
unique schema mapping
⇒
M
:
A
→
A
between a schema database
A
into a distinct
target schema
A
, in a way such that a mapping has no significant compositions
with another “real” inter-schema mappings of a given database mapping system.
Moreover, these obtained SOtgd (in
) from the integrity constraints of a given
schema, have to be only “logical”, that is, with no transfer of information from the
source database
M
A
into the target database
A
(differently from the inter-schema
mappings in Definition
3
).
As we will see, it will be provided by the fact that the right-hand side of
eac
h
i
m
plication in the obtained SOtgd (in
M
) will have the false ground atom
r
(
0
,
1
)
, where the relational symbol
r
(introduced in Sect.
1.3
as a binary built-
.
=
in predicate for the FOL identity
) is the unique relational symbol of the schema
A
=
(
{
r
}
,
∅
)
.
2.2.1 Transformation of Tuple-Generating Constraints into SOtgds
A normalized (with a simple atom on the right-hand side of implication) integrity
constraint (tgd)
(S
A
,Σ
A
)
(in Definition
2
) has on the right-hand side of implication the relational symbol
r
∀
x
(φ
A
(
x
)
⇒
r(
t
))
∈
Σ
A
of a given schema database
A
=
of this database schema. Thus, in order to satisfy the previously considered
requirements for a “logical” representation of such a tgd, we have to transform such
an implication by keeping in mind the following considerations:
Each normalized tgd
∈
A
r
(
t
))
is a
falsity
(false for every assignment of the values to variables in
x
).
Con
sequently, we will
represent this tgd by the formula
∀
x
(φ
A
(
x
)
⇒
r(
t
))
is satisfied if
(φ
A
(
x
)
∧¬
∀
∧¬
⇒
x
((φ
A
(
x
)
r(
t
))
r
(
0
,
1
))
, with the built-in
used for the FOL identity
.
=
identity relational symbol
r
, as follows:
Lemma 2
Any normalized tgd constraint of a schema
x
φ
A
(
x
)
r(
t
)
∈
Σ
eg
A
⊆
A
=
(S
A
,Σ
A
),
∀
⇒
Σ
A
,