Question
Consider a DB schema consisting of the following relation schemes: Person ( name, age, gender) - Describes person Frequents ( name, pizzeria ) Frequency of
Consider a DB schema consisting of the following relation schemes:
Person ( name, age, gender) - Describes person
Frequents ( name, pizzeria ) Frequency of a person
Eats ( name, pizza ) - What a person is eating
Serves ( pizzeria, pizza, price ) - Information about serves
Now, express the following queries in Relational Algebra: (all questions please)
1) Find all the persons under the age of 18.
2) Find all the pizzerias that serve at least one pizza that Amy eats for less than $10.00
3) Find all the pizzerias frequented by at least one person under the age of 18
4)Find all the pizzerias frequented by at least one person under the age of 18 and at least one person over the age of 30.
5) Find all pizzerias frequented by at least one person under the age of 18 and at least one person over the age of 30. Print out all the quintuples (pizzeria, person1, age1, person2, age2), where person1 and person2 are persons who frequent the pizzeria, and person1 is under the age of 18 and person2 is over the age of 30.
6) For each person, find how many types of pizzas he/she eats. Show only those people who eat at least two types of pizzas. Sort in descending order of the number of types of pizzas they eat.
7) For each type of pizza, find its average price. Sort descending by average price.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started