In this paper, we consider conjunctive queries with built-in predicates of the form X < Y, X ≤ Y, X = Y, or X ⊋ Y, where X and Y are variables or constants from a totally ordered domain. We present a sufficient and necessary condition to test containment
among these kinds of queries. Klug [8] left the problem open for the case when the domain is nondense, like the integers.
Ullman [11] gave only a sufficient condition for the containment of conjunctive queries with built-in predicates and integer
variables. Our test is based in a method that uses a new idea: the representation of an infinite number of databases by a
finite set of, what we call, canonical databases, that use variables that denote uninterpreted constants.
This work was partially supported by CICYT grant TEL96-1390-C02 and by NSF grant HRD-9628450.