We introduce a new constraint domain, aggregation constraints, that is useful in database query languages, and in constraint logic programming languages that incorporate aggregate functions. First, we formallystudy the fundamental problem of determining if a conjunction of aggregation constraints is solvable, and show that, for many classes of aggregation constraints, the problem is undecidable. Second, we describe a complete and minimal axiomatization of aggregation constraints, for the SQL aggregate functions min, max, sum, count and average, over a non-empty, nite multiset on several domains. This axiomatizationhelps identify e ciently solvable classes of aggregation constraints. Third, we present a polynomial-time algorithm that directly checks for solvability of a conjunction of aggregation range constraints over a single multiset; this is a practically useful class of aggregation constraints. Fourth, we discuss the relationships between aggregation constraints on a nite multiset...
Kenneth A. Ross, Divesh Srivastava, Peter J. Stuck