Database Reference
In-Depth Information
clause of
an aggregate query means considering queries which satisfy a “steadiness” condi-
tion analogous to that imposed on steady aggregate constraints (see Definition 2.2).
Given an instance D of
Basically, the restriction that no measure attribute occurs in the
WHERE
D
, the evaluation of an aggregate query q on D will be
denoted as q
(
D
)
.
Example 5.2. Queries q 1 ,
q 2 and q 3 defined in Example 5.1 can be expressed as fol-
lows:
q 1 = SELECT MAX (
Value
) FROM
BalanceSheets
Subsection
=
'cash sales'
WHERE
q 2 = SELECT MIN (
Value
) FROM
BalanceSheets
Subsection
=
'cash sales'
WHERE
q 3 = SELECT SUM (
Value
) FROM
BalanceSheets
Subsection
=
'cash sales'
WHERE
We now introduce the fundamental notion of range-consistent answer of an ag-
gregate query. Basically, it consists in the narrowest range [greatest-lower bound
(glb), least-upper bound (lub)] containing all the answers resulting from evaluat-
ing the query on every database resulting from the application of a card -minimal
repair 1 .
Definition 5.2 (Range-consistent query answer). Let
D
be a database scheme,
AC
a set of aggregate constraints on
D
, q an aggregate query on
D
, and D
an instance of
D
. The range-consistent query answer of q on D , denoted as
CQA q
D,AC (
D
)
is the empty interval 0, in the case that D admits no repair w.r.t.
AC
[
,
]
, otherwise, where:
i) for each card -minimal repair
, or the interval
glb
lub
ρ
for D w.r.t.
AC
, it holds that glb
q
( ρ (
D
))
lub ;
ii) there is a pair
ρ ,
ρ of card -minimal repairs for D w.r.t.
( ρ (
AC
such that q
D
)) =
( ρ (
glb and q
D
)) =
lub .
Example 5.3. In our running example, the narrowest range including the evaluations
of query q 1 on every database resulting from the application of a card -minimal re-
pair is
[
1110
,
1150
]
(as shown in Example 2.12, the card -minimal repairs are
ρ 1 and
ρ 5 ; q 1 evaluates to 1150 and 1110 on the databases repaired by
ρ 1 and
ρ 5 , respec-
tively). Hence, the range-CQA of query q 1 is
[
1110
,
1150
]
. Similarly, it is easy to
see that the range-CQAs of q 2 and q 3 are
[
900
,
1110
]
and
[
2010
,
2260
]
, respectively.
5.3 Evaluating Range-Consistent Query Answer
In this section, we define a strategy for computing range-consistent answers of ag-
gregate queries in the presence of steady aggregate constraints. Before describing
1 It is worth n oting that, as in this chapter we assume that the do main of measure attributes is
bounded by M , card -minimal repairs considered here consists of M -bounded atomic updates.
 
Search WWH ::




Custom Search