I'm not able to figure out the difference between these queries. I'm pretty sure that the first one is an equi-join. I'm not sure how the second one ISN'T the same as the first. The sub query in #2 selects all Ids from S, and then it returns all R's that also have those ID's, no?
SELECT R.cname FROM R, S, WHERE R.Id = S.Id
SELECT R.cname FROM R WHERE R.Id IN (SELECT S.Id FROM S)
EDIT:
i grabbed this off a past exam....and I quote:
Although the queries seem to produce the same answers they don’t. How do they
differ? You can give example instances of R and S that show that
these two queries can produce different answers.
R (Id, TourId, cname, caddress, cost)
S (Id, SpecId)
EDIT: EDIT:
I'm guessing it has to do with duplicates.