Databases Reference
In-Depth Information
FROM V_Wellness_Program_Epis AS wp,
V_Policy_Epis AS pol
WHERE wp.wellpgm_nm
'Diabetes'
¼
'1/1/2009'
AND wp.epis_beg_dt '12/31/2009'
As we said previously, these queries are not intended to repre-
sent realistic scenarios. Their sole purpose is to demonstrate that
all Allen relationships can be expressed as queries against
asserted version tables. Note in particular that the two tables in
this view are not correlated by a key, whereas they normally
would be correlated with a join predicate. This is so we can see
how the Allen relationships correlate the two tables using dates.
AND wp.epis_beg_dt
Time Period to Time Period Queries
Allen relationships may relate two time periods, or a time
period to a point in time, or two points in time. We will represent
time periods, using our closed-open notation, as follows:
Period 1: [eff_beg_dt 1 - eff_end_dt 1 ]. Referred to as P 1 .
Period 2: [eff_beg_dt 2 - eff_end_dt 2 ]. Referred to as P 2 .
Eff_beg_dt 1 is earlier than eff_end_dt 1 , and eff_beg_dt 2 is
earlier than eff_end_dt 2 . This is true even for the limiting case
of a time period that includes only a single clock tick.
P 1 [starts] P 2
This is a pair of relationships, one the inverse of the other. 1
In the non-superscripted relationship, the first time period is
the shorter one. Figure 14.2 shows this relationship, and its place
in our taxonomy. The two dashed lines in the illustration graph-
ically represent P 1 and P 2 , with P 1 being the upper dashed line.
The predicate for this relationship, as it holds between two
time periods expressed as pairs of dates using the closed-open
convention, is:
(eff_beg_dt 1 ¼ eff_beg_dt 2 )
AND (eff_end_dt 1 < eff_end_dt 2 )
It says that P 1 and P 2 begin at the same time, but that P 1 is the
first to end, and is therefore the shorter of the two time periods.
The inverse of this relationship is: P 1 [starts 1 ]P 2 . In the
superscripted relationship, the first time period is the longer
one. The predicate for this relationship, as it holds between
1 The names of the Allen relationships are standard. They were provided by Allen in his
original article, and continue to be used throughout the computer science literature.
 
Search WWH ::




Custom Search