Relational Algebra -Practice Questions

preview_player
Показать описание
Review Questions:
Write relational algebra queries for the following questions using the database from the video:

Note: For queries that are the same as the ones solved in the video, try to write equivalent queries.

1. Find all pizzerias frequented by at least one person under the age of 18.
2. Find the names of all females who eat either mushroom or pepperoni pizza (or both).
3. Find the names of all females who eat both mushroom and pepperoni pizza.
4. Find all pizzerias that serve at least one pizza that Amy eats for less than $10.00.
5. Find all pizzerias that are frequented by only females or only males.
6. For each person, find all pizzas the person eats that are not served by any pizzeria the person frequents. Return all such person (name) / pizza pairs.
7. Find the names of all people who frequent only pizzerias serving at least one pizza they eat.
Рекомендации по теме
Комментарии
Автор

Thanks for the content. Your videos will get me through tomorrow's exam for sure. You're a great teacher.

roryboyes
Автор

Find all pizzerias that serve at least one pizza that Amy eats for less than $10.00.
ANSWER:
πpizzeria ( σname="Amy" ^ price<"10.00" ( Frequents ⋈ serves))

lifestyle
Автор

πpizzeria ( σgender="male" (person ⋈ Frequents)) U πpizzeria ( σgender="female" (person ⋈ Frequents))

for QUESTION all pizzerias are frequented by only females and males. Is correct or not. please answer.

quotescientist