Re: Join types



Jonathan Leffler wrote:
Bob Badour wrote:

JOG wrote:

On Jan 25, 11:04 am, Gints Plivna <gints.pli...@xxxxxxxxx> wrote:

I'm a bit studying join types and trying to make a visualisation of
relations among them. As a result I've created an ER diagram
describing relations among them and it can be found here: http://gplivna.blogspot.com/2008/01/sql-join-types-im-studying-bit-sq...

I've tried to find something like that using google however the best I
could get was textual description. I'm not mathematician and studied
set theory a bit 10 years ago in university and almost all have no
forgotten :) so maybe it has some problems from set theory viewpoint.
So question is - is it generally ok? If you know anything similar
please add link either here or in my blog post. All comments welcome!
Thanks!
Gints

Having only looked at your breakdown briefly, I can't give you much
comment (although I thought your time-bomb discussion of natural joins
was entertaining). However, I would say that in general I view natural
joins, equi-joins, etc. as specializations of the generalized theta
join. I'd be interested if other's share this perspective.

I do not share the perspective. I prefer to view theta join as natural join followed by restrict.

Can you explain how that works? I can see theta join as cartesian product followed by restrict, but I don't see how you do a 'greater than' join with a natural join -- unless you rename one (or both) of the join terms so that natural join degenerates into cartesian product and then you restrict on the renamed terms. But that's not an obvious use of a natural join, I think.

Cartesian product is only a special case of natural join. How do you express the inequality if the join attributes have the same name? What is the corresponding value in each tuple?


One might argue it's just a question of one's choice of primitives. I would argue that both natural join and restrict are simpler operations than theta join.
.