将SQL代码转换为Relational Algebra

时间:2014-05-15 08:46:39

标签: mysql sql relational-algebra

如何将此Select查询转换为关系代数:

SELECT Student.Name, Result.Mark
FROM Student, Results
WHERE Student.ID = Results.ID AND Results.Code = 'G51DBS'

这就是我所拥有的,但我不确定:

[σ{Student.Name}(Student)]∪[Π{Result.Makr}σ{Student.ID = Results.ID ∧ results.code = g51dbs}(Results)]

1 个答案:

答案 0 :(得分:2)

我认为应该是这样的:

∏Name,Mark (σResult.Code="G51DBS"(Student⋈Result))

您可能希望查看此tutorial和自然加入this