1

I'm just getting started on an intro to databases course and have a question about writing relational algebra expressions.

Schema:

Person ( name, age, gender )
Frequents ( name, pizzeria )
Eats ( name, pizza )
Serves ( pizzeria, pizza, price )

I have a practice question like such: Find all pizzerias that serve at least one pizza that Amy eats for less than $10.00.

My answer is: πpizzeria (σname = 'Amy' ^ price < $10 (Person ⨝ Serves))

A correct answer is: πpizzeria (σname = 'Amy' (Eats) ⨝ σprice < $10 (Serves))

I would like to know if these two are equivalent to each other, and if not, why not?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.