📜  资质| GATE CS 1998 |第62章

📅  最后修改于: 2021-06-29 06:17:19             🧑  作者: Mango

假设我们有一个包含以下三个关系的数据库。

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; 

这个问题的测验