假设我们有一个包含以下三个关系的数据库。
FREQUENTS(student, parlor) giving the parlors each student visits.
SERVES(parlor, ice-cream) indicating what kind of ice-creams each parlor serves.
LIKES(student, ice-cream) indicating what ice-creams each parlor serves.
(Assuming that each student likes at least one ice-cream and frequents at least one parlor)
在SQL中表达以下内容:
打印出经常去至少一个会客制冰淇淋店的学生。回答:
说明:答案:
SELECT DISTINCT FREQUENTS.student FROM
FREQUENTS, SERVES, LIKES
WHERE
FREQUENTS.parlor=SERVES.parlor
AND
SERVES.ice-cream=LIKES.ice-cream
AND
FREQUENTS.student=LIKES.student;
这个问题的测验