我们有三种关系:
Students(sid, sname) Courses(cid, cname, dept) take(sid, cid, grade)
We want to find student numbers of students whose these students take all courses that present in 'CS' department .
We want to find student numbers of students whose these students take all courses that present in 'CS' department
为什么(第4行)是这个问题的答案?
任何人都可以说不同于(第1行)到(第3行)。我在DB的Solved Ex中读到了这篇文章。
第四行的另一种表达方式是:
all students except ( all combinations of students and CS courses except all taken courses )
括号之间的集合包含所有未参加的学生+CS课程组合。从所有学生中减去这个,你就得到了参加所有CS考试的学生。