我有以下表格:
Employee
|name|employee_cod|
Project
|name|project_cod|
Work
|employee_cod|project_cod|
那么,如何列出不工作的员工的姓名,例如在 project_cod = 1 的项目中,使用关系代数?
以下不起作用:
π(employee.name(σ work.project_cod != 1 (Employee ∞ Work ∞ Project)
因为如果我在工作表中有以下数据:
| employee_cod | project_cod |
-------1--------------1-------
-------1--------------2-------
-------1--------------3-------
-------2--------------2-------
这σ work.project_cod != 1
将导致:
| employee_cod | project_cod |
-------1--------------2-------
-------1--------------3-------
-------2--------------2-------
但是code = 1的员工不应该被退回,因为它参与了项目1