Closed apjanke closed 5 years ago
Okay, looking at https://en.wikipedia.org/wiki/Relational_algebra#Semijoin_(%E2%8B%89)(%E2%8B%8A), the predicate is a "for all", and "for all" degenerates to true in the case of no things. So, yeah, degenerate semijoin should be the input, and degenerate antijoin should be empty.
The degenerate cases of natural
semijoin
andantijoin
where they have no variable names in common probably have a correct output, so they should produce output instead of error like they do now.I think it's the case that: a) The degenerate case of JOIN is the cartesian product (all rows in A match all rows in B). b) Thus, the degenerate case of semijoin should be that all rows in the inputs are kept. c) And thus, the degenerate case of antijoin should be the empty set, because antijoin is simply the inverse of the results of semijoin. But I need to verify that.