关系代数和混淆一个复杂的例子

Relational Algebra and Confusing one Complex Examples

我们有 3 个关系:

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

why (line 4) is the answer of this query ?

任何人都可以说从(第 1 行)到(第 3 行)不同。我在 DB 的 Solved-Ex 中读到了这个。

第四行的另一种表达方式是:

all students
except
(
    all combinations of students and CS courses
    except
    all taken courses
)

括号中的集合包含所有未参加的学生+ CS 课程组合。从所有学生中减去这个,你得到参加所有 CS 考试的学生。