.TH Not_matching .PP Aka 'where not exists' .SH Signature .PP .RS .nf not_matching(left: Relation, right: Relation) -> Relation .fi .RE .SH Examples .PP .RS .nf not_matching(suppliers, supplies) .fi .RE .SH Description .PP Computes a relation as a subset of \fB\fCleft\fR tuples for which no tuple from \fB\fCright\fR would join on common attributes. .PP This operator is the inverse of \fB\fCmatching\fR, as shown by the definition below. It keeps all tuples from \fB\fCleft\fR but those that match a tuple from \fB\fCright\fR\&. .PP .RS .nf def not_matching(left, right) minus(left, matching(left, right)) end not_matching(suppliers, supplies) .fi .RE .PP The synonym 'where not exists' comes from the fact that, since right attributes do not appear in the result, it may seem more intuitive to think about this operator as filtering tuples from left where \fIthere does not exist\fP any tuple from right that \fIwould\fP join. In SQL terms: .PP .RS .nf SELECT * FROM left WHERE NOT EXISTS (SELECT * FROM right WHERE [join condition]) .fi .RE .SH Implementation notes .PP As for join and matching, you must take care of ensuring that the list of common attributes on which the (not) matching applies corresponds to what you want. Renamings and projections are worth having at hand. Alternatively, shortcuts can be considered (see \fB\fCmatching\fR and \fB\fCjoin\fR).