Question: Exercise 2 Given the following relational model database schema (other relations may exist but are not relevant for this exercise): LIKE_BEER (Person, Beer) VISIT_TAP_HOUSE (Person,
Exercise 2
Given the following relational model database schema (other relations may exist but are not relevant
for this exercise):
LIKE_BEER (Person, Beer) VISIT_TAP_HOUSE (Person, Tap_House) SELL_BEER (Tap_House, Beer)
Note: the attributes hold the name of the denoted object. E.g. beer hold the name of the beer.
Solve the following queries using Relational Algebra.
1. List all the tap houses that sell any beer liked by some person. [5 marks]
2. List all the tap houses that sell any beer liked by John Smith. [5 marks]
3. List the people (person name) that only visit Falling Rock Tap House tap house. [6 marks]
4. List the people that visit a tap house that sells at least one beer they like. [6 marks]
5. List the tap houses that sell any beer that more than one person likes. [6 marks]
6. List the people that visit two or more tap houses. [6 marks]
7. List the people that only likes Coors beer. [8 marks]
8. List the tap houses that offer all the beers Jane Doe likes. [8 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
