2
$\begingroup$

For the following schema

Country ("countryID", cName)
CoffeeShop ("shopID", sName, countryID, city)
Product ("productID", size)
Serves ("shopID", "productID")
ProductNames ("productID", "countryID", pName)

where attributes in quotation marks are primary keys, I must write a relational algebra statement for the following query:

List names of products that have same names in all countries they are served.

The thing that made me stuck on this problem is the fact that the product must not necessarily be served in all countries, but rather have the same name in all countries it is served. Without comparing for an initial value, I couldn't get a solution that makes more sense and that is possible to be written as a relational algebra statement.

$\endgroup$
1
$\begingroup$

Hint: A product has the same names in all countries if for every two countries, it has the same name in both countries.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.