Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Relational algebra
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Antijoin === The antijoin (β·), written as ''R'' β· ''S'' where ''R'' and ''S'' are [[relation (database)|relation]]s,{{efn|In [[Unicode]], the Antijoin symbol is β· (U+25B7).}} is similar to the semijoin, but the result of an antijoin is only those tuples in ''R'' for which there is ''no'' tuple in ''S'' that is equal on their common attribute names.<ref name=unnesting>{{Cite conference |title=Unnesting Arbitrary Queries |conference=BTW |last=Neumann |first=Thomas |url=https://dl.gi.de/handle/20.500.12116/2418 |year=2015 |doi=}}</ref> For an example consider the tables ''Employee'' and ''Dept'' and their antijoin: {{col-begin|width=auto; margin:0.5em auto}} {{col-break}} {| class="wikitable" |+ ''Employee'' |- ! Name !! EmpId !! DeptName |- | Harry || 3415 || Finance |- | Sally || 2241 || Sales |- | George || 3401 || Finance |- | Harriet || 2202 || Production |} {{col-break|gap=2em}} {| class="wikitable" |+ ''Dept'' |- ! DeptName !! Manager |- | Sales || Sally |- | Production || Harriet |} {{col-break|gap=2em}} {| class="wikitable" |+ ''Employee'' β· ''Dept'' |- ! Name !! EmpId !! DeptName |- | Harry || 3415 || Finance |- | George || 3401 || Finance |} {{col-end}} The antijoin is formally defined as follows: : {{math|1 =''R'' β· ''S'' = { ''t'' : ''t'' β ''R'' ∧ Β¬∃''s'' β ''S''(''Fun'' (''t'' ∪ ''s'')) }}} or : {{math|1 = ''R'' β· ''S'' = { ''t'' : ''t'' β ''R'', there is no tuple ''s'' of ''S'' that satisfies ''Fun'' (''t'' ∪ ''s'') }}} where {{math|''Fun'' (''t'' ∪ ''s'')}} is as in the definition of natural join. The antijoin can also be defined as the [[Complement (set theory)|complement]] of the semijoin, as follows: {{NumBlk|:| {{math|1=''R'' β· ''S'' = ''R'' − ''R'' β ''S''}} |{{EquationRef|5}}}} Given this, the antijoin is sometimes called the anti-semijoin, and the antijoin operator is sometimes written as semijoin symbol with a bar above it, instead of β·. In the case where the relations have the same attributes (union-compatible), antijoin is the same as minus.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)