Here is ChrisChen3121’s solution with changes only to parentheses, comments, and line breaks. Most parentheses line up vertically with their match. Following the aesthetically re-written code are the intermediate relations produced in an attempt to visualize/conceptualize the solution.
Find the "Over-30-Pizzas" target list (those eaten by 30+-year-olds);
With \cross
, build a "Fantasy-Superset" list of all pizzerias combined with Over-30-Pizzas, as if all pizzerias served the target Over-30-Pizzas;
Subtract out from there the "Actually-Served" list of what pizzerias serve in reality to create a "What's-Missing" list;
From [a fresh copy of] what's Actually-Served, subtract out pizzerias appearing in What's-Missing.
// "Actually-Served" list of what pizzerias serve in reality. Results shown below.
\project_{pizzeria}(Serves)
\diff
\project_{pizzeria}
(// "What's-Missing" list. Results shown below.
(// "Fantasy-Superset" list of all pizzerias combined with Over-30-Pizzas. Results shown below.
// NOTE: Some combos here do not match reality.
// all pizzarias
\project_{pizzeria}(Serves)
\cross
// "Over-30-Pizzas" target list (those eaten by 30+-year-olds). Results shown below.
\project_{pizza}(\project_{name}(\select_{age > 30 }(Person)) \join Eats)
// What I used instead, it’s equivalent.
// \project_{pizza}(\select_{age > 30} Person \join Eats)
)
\diff
// "Actually-Served" list of what pizzerias serve in reality. Result shown below.
\project_{pizzeria,pizza}(Serves)
)
// "Over-30-Pizzas" target list (those eaten by 30+-year-olds).
cheese
supreme
// "Fantasy-Superset" list of all pizzerias combined with Over-30-Pizzas.
// NOTE: some combos do not match reality.
Chicago Pizza | cheese
Chicago Pizza | supreme
Dominos | cheese
Dominos | supreme
Little Caesars | cheese
Little Caesars | supreme
New York Pizza | cheese
New York Pizza | supreme
Pizza Hut | cheese
Pizza Hut | supreme
Straw Hat | cheese
Straw Hat | supreme
// "Actually-Served" list of what pizzerias serve in reality.
Chicago Pizza | cheese
Chicago Pizza | supreme
Dominos | cheese
Dominos | mushroom
Little Caesars | cheese
Little Caesars | mushroom
Little Caesars | pepperoni
Little Caesars | sausage
New York Pizza | cheese
New York Pizza | pepperoni
New York Pizza | supreme
Pizza Hut | cheese
Pizza Hut | pepperoni
Pizza Hut | sausage
Pizza Hut | supreme
Straw Hat | cheese
Straw Hat | pepperoni
Straw Hat | sausage
\\ "What's-Missing" list.
Difference (what’s left over) after the Actually-Served is subtracted from the Fantasy-Superset. "These pizzerias do not serve the required pizza listed."
Dominos | supreme
Little Caesars | supreme
Straw Hat | supreme