= Solution
Take a unary <database relation> $R$ and the positive <domain relational calculus> query
$$
\boxed{Q=\{(x,y)\mid R(x)\lor R(y)\}.\quad\text{The assertion is false.}}
$$
For the finite input $R=\{0\}$, every pair $(0,d)$ and $(d,0)$ belongs to $Q$, for every value $d$ in the ambient domain. On an infinite ambient domain the answer is infinite. Even if one compares only finite ambient domains, adding a fresh value $d$ changes the answer while leaving $R$ fixed, violating <domain independence of a database query>.
The <logical disjunction> leaves $y$ unrestricted in its first branch and $x$ unrestricted in its second branch. Thus both variables occur in relational atoms somewhere in the formula, yet <database query safety> still fails. No negation or implication symbol occurs.
Back to article page