Вопрос

I am wondering whether the natural join operation in relational algebra is associative. I mean, is the following equation true?

(S1 NATURAL JOIN S2) NATURAL JOIN S3 = S1 NATURAL JOIN (S2 NATURAL JOIN S3)

It looks associative to me intuitively, but i am not sure.

Thanks

Это было полезно?

Решение

An inner join only returns rows that match the on condition. It does not have special treatment for either the right or the left hand table. So an inner join is associative.

A natural join is an inner join on all columns with the same name. Since an inner join is associative, so is a natural join.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top