Let us say I have this schema.
Boats
_____
bid
bname
Reserves
________
sid
bid
date
Sailors
_______
sid
sname
I know that inner joins are supposed to be both associative and commutative, but I cannot really understand why.
Given the query:
SELECT sname, bname
FROM (Sailors NATURAL INNER JOIN Boats) NATURAL INNER JOIN Reserves
I am thinking that this should return null
since Sailors and Boats have no common fields, while:
SELECT sname, bname
FROM (Sailors NATURAL INNER JOIN Reserves) NATURAL INNER JOIN Boats
should return the names of Sailors and the names of Boats they reserved.
Please tell me why inner joins are then supposed to be both commutative and associative.
Thanks!