私はデータベースコースを改訂しており、正しい答えがあるかどうかわからない過去の課題から次の質問があります。ここで質問です:ここではTuple Relational Calculusクエリ
The database schema is as follows:
• LIKES(drinker,beer);
• FREQUENTS(drinker,bar);
• SERVES(bar,beer,cost);
• Bars can serve many beers, drinkers can frequent many bars, and they can like many beers.
However, a bar cannot serve the same beer at different costs.
Write the following query in relational calculus: Find bars that serve at least one beer liked by Joe, but do not serve any beer liked by
Michael.
は私が持っているものです。
{P | ∃L1 ∈ LIKES ∃L2 ∈ LIKES ∃S ∈ SERVES(L1.drinker='Joe'^S.beer = L1.beer^L2.drinker = 'Michael'^L1.beer != L2. beer^P.bar = S.bar)}
これは大丈夫に見えるのか? ありがとう