Class O2.S8 (Other, Interval, Other)


=centercr @ []Query Q 3.8.1: Find the beginning of the period which includes the year 1989 and in which Edward had a constant salary.
Answer: ``1/1/88.''
Category: (None, Not Empty) / (Containment, Interval, Explicit) / (=, Constant)

Edward has got a constant salary since 1/1/88. As this period includes 1989, 1/1/88 is the answer.

Assuming that valid-time intervals of employee data with a constant salary can be extracted from the relation employee (it can be noticed that, if the relation is stored by means of temporally homeogeneous tuples, the employee histories must be coalesced after projection on salary in order to obtain maximal intervals in which the salary has not been changed), those concerning Edward can be selected via a ``(=, Constant)'' predicate. The query retrieves the beginning of the computed period which contain the explicit interval 1/1/89 – 12/31/89, according to a ``(Containment, Interval, Explicit)'' temporal predicate.


=centercr @ []Query Q 3.8.2: Find the dates Ed acquired a skill before or after years 1984–1985.
Answer: ``1/1/82'' and ``4/1/82.''
Category: (None, Not Empty) / (Ordering, Interval, Explicit) / (=, Constant)

Before or after years 1984–1985, Ed acquired a skill on 1/1/82 (driving) and on 4/1/82 (typing).

The beginning of the valid-times of Ed's skills are selected if they precede or follow the explicit interval ``1/1/84 – 12/31/85,'' according to the category ``(Ordering, Interval, Explicit).'' A non-temporal predicate in the category ``(=, Constant)'' is used to select Ed's data in relation skills.


=centercr @ []Query Q 3.8.3: Find ED's unemployment periods when he was not 30 years old
Answer: ``1/31/87 – 1/4/87.''
Category: (None, Not Empty) / (Ordering, Interval, User-defined) (Containment, Interval, User-defined) / (=, Constant)

ED has been 30 years old from 7/1/85 to 6/30/86. Before 7/1/85 or after 6/30/86, he was unemployed from 1/31/87 to 1/4/87.

The query is categorized as ``(Ordering, Interval, User-defined)'' because valid-times of data are selected if they precede or follow an interval which is computed from user-defined times stored in other data, that is 7/1/85 – 6/30/86. The other temporal predicate, in the category ``(Containment, Interval, User-defined),'' is used because valid-times qualify for the query also when they overlap the interval 7/1/85 – 6/30/86 without being completely contained in it. In this case, only the portion of the qualifying intervals outside 7/1/85 – 6/30/86 must be retrieved. Non-temporal predicates in the category ``(=, Constant)'' are used to restrict employee to ED's data (Name="Ed" or Name="Edward"), and to find out the periods in which he was unemployed (e.g. testing for null values of his department and salary; for the problem of coalescing intervals, see the discussion of query Q 3.8.1). The restriction to ED's data also allows the determination of his date of birth which is used for the temporal selection.


=centercr @ []Query Q 3.8.4: Find the period in which Di worked in the department in which she has been working during the whole 1987
Answer: ``1/1/82 – now.''
Category: (None, Not Empty) / (Containment, Interval, Explicit) / (=, Constant)

Di worked in Toy department during 1987. She has worked in that department from 1/1/82.

The category ``(Containment, Interval, Explicit)'' indicates that a containment-based predicate is used to select employee data whose valid-times contain the user-supplied interval ``1/1/87 – 12/31/87.'' As in Query Q 3.8.1, we assume that periods in which an employee worked in the same department can be determined. Di's data are selected via a ``(=, Constant)'' non-temporal predicate. If the containment test succeds, the entire element-valued valid-time argument of the predicate is retrieved.


=centercr @ []Query Q 3.8.5: Find all the dates from 1/1/83 to 12/31/85 at which the Toy department budget changed
Answer: ``8/1/84.''
Category: (None, Not Empty) / (Containment, Interval, Explicit) (Ordering, Interval, Computed) / (=, Single) (< >, Single)

From 1/1/83 to 12/31/85, the Toy budget changed only on 8/1/84.

In this query, there are two valid-time selection predicates. The one used for categorization is ``(Containment, Interval, Explicit)'' and selects the dates of interest by means of their containment in an interval explicitly supplied in the query. The other one, ``(Ordering, Interval, Computed),'' is used to determine two consecutive versions of department data, testing if their valid-time intervals meet. The non-temporal predicates are also used for their determination: the two versions must have the same department name — according to ``(=, Single)'' — and different salary values — according to ``(< >, Single)''.