1

如何将此 SQL 查询写入关系代数?

Select Distinct S.Name
From Student S, Transcript T1, Transcript T2
WHERE T1.StudId = S.Id AND T2.StudId = S.Id And
(T1.Semester =’S1997’ AND T2.Semester = ’F1998’)
4

1 回答 1

1

当我无法测试它并且我不知道您的关系模式时,很难说出确切的表达方式,但是像这样尝试

\project_{Name}
{
    {
        Student \join_{Id = StudId} \select_{Semester='S1997'} Transcript
    } \join_{Id = StudId}
    {
       \select_{Semester='F1998'} Transcript
    }
}
于 2012-10-15T07:59:57.543 回答