Expressing Constraints Formally
Relational calculus is a notation for expressing relation values in terms of given named relations and sometimes constants. So is relational algebra. A constraint is an expression making a statement about one or more relation values. But such a statement is not relation-valued, so you can't express it in relation-valued notation alone. (So you need to ask what exactly is wanted.)

You have to have operators returning equality of relations, or whether a relation is empty, etc. (Either of those two is sufficient.)

-- every teacher is a person
empty({&lt;id&gt;|(exists class Teaches(id, class)) and not Person(id)})


A query is typically like {tuple|formula}. You could use an expression like the formula part of a query if you consider any free variables/attributes to be implicitly universally quantified. (This is also sufficient.)

-- id is a superkey of Teaches
-- forall id, c1, c2
    Teaches(id, c1) and Teaches(id, c2) implies c1=c2


(empty({&lt;...&gt;|formula}) is the same as forall ... notformula.)