How do I represent the SQL "not exists" clause in relational algebra?
The SQL NOT EXISTS
construct can be represented in relational algebra by the antijoin ▹
.
The antijoin L ▹ R
of two relations L
and R
selects those tuples of L
that do not join with any tuple in R
. It can be defined in terms of set difference and left semijoin as follows:
L ▹ R = L - (L ⋉ R).