A Note on Range Variables
Really needed only if the same relation appears twice in the FROM clause. The previous query can also be written as:
SELECT S.sname
FROM Sailors S, Reserves R
WHERE S.sid=R.sid AND bid=103
SELECT sname
FROM Sailors, Reserves
WHERE Sailors.sid=Reserves.sid
AND bid=103
It is good style,
however, to use
range variables
always!
OR
Previous slide
Next slide
Back to first slide
View graphic version