表:
Contest(starter, ender, pointsStarter, pointsEnder, debatedate)
Debater(name, club, age)
询问:
提供比赛的所有比赛细节,其中首发辩手是“柏拉图”俱乐部的成员,并阻止他的对手得分。
我写的SQL:
SELECT starter, pointsStarter, ender, pointsEnder, debatedate
FROM contest
WHERE pointsEnder = 0
AND starter IN (SELECT name FROM debater WHERE club = 'Plato')
我写过的关系代数:
Π starter,ender,pointsStarter,pointsEnder,debatedate (
Ϭ Contest.pointsEnder=0 (
Ϭ club=”Plato” (Contest Debater)))
我写过的领域关系演算:
{< starter,ender,pointsStarter,pointsEnder,debatedate> |
Ǝ < starter,ender,pointsStarter,pointsEnder,debatedate > ϵ Contest (
Ǝ < name,club,age > ϵ Debater (
^ pointsEnder=0 ^ club=”Plato”))
}