Constraint relational databases use constraints to both model and quer
y data. A constraint relation contains a finite set of generalized tup
les. Each generalized tuple is represented by a conjunction of constra
ints on a given logical theory and, depending on the logical theory an
d the specific conjunction of constraints, it may possibly represent a
n infinite set of relational tuples. For their characteristics, constr
aint databases are well suited to model multidimensional and structure
d data, like spatial and temporal data. The definition of an algebra f
or constraint relational databases is important in order to make const
raint databases a practical technology In this paper, we extend the pr
eviously defined constraint algebra (called generalized relational alg
ebra). First, we show that the relational model is not the only possib
le semantic reference model for constraint relational databases and we
show how constraint relations can be interpreted under the nested rel
ational model. Then, we introduce two distinct classes of constraint a
lgebras, one based on the relational algebra, and one based on the nes
ted relational algebra, and we present an algebra of the latter type.
The algebra is proved equivalent to the generalized relational algebra
when input relations are modified by introducing generalized tuple id
entifiers. However, from a user point of view, it is more suitable. Th
us, the difference existing between such algebras is similar to the di
fference existing between the relational algebra and the nested relati
onal algebra, dealing with only one level of nesting. We also show how
external functions can be added to the proposed algebra.