Written by
Dimitri Yatsenko, PhD
Founder • Chief Science & Technology Officer
August 13, 2017

Strong Entity Integrity: Part 6 — Semijoin and antijoin

Dimitri Yatsenko, PhD
Founder • Chief Science & Technology Officer

Argh, semijoins and antijoins are misnamed.

There is a zoo of joins in relational algebra (and SQL): cross join, equijoin, natural join, inner join, theta join, left join, and outer join. They follow a pattern: they have all the attributes of its operands. Semijoins and antijoins are different. They have only the attributes and the tuples from their left argument. Indeed, semijoins and antijoins are a form of restriction (or selection).

In DataJoint, the terms semijoins and antijoins are not used to avoid the confusion. Both these operators fit the definition of the restriction operator. DataJoint uses the same operators & and - as for other forms of restriction.

Therefore, the Strong Entity Integrity considerations for these operators are the same as in restriction.

However, there is something in common with the join: the join compatibility rules. Restriction by another relation should only be performed on attributes that are in the primary key or a foreign key in both operands: they must be part of the identifying attributes that is used to identify and match entities across different entity sets.

Related posts

Updates Delivered *Straight to Your Inbox*

Join the mailing list for industry insights, company news, and product updates delivered monthly.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.