Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sleepypioneer/5b17283bc82b14b7fc665338f6f11e38 to your computer and use it in GitHub Desktop.
Save sleepypioneer/5b17283bc82b14b7fc665338f6f11e38 to your computer and use it in GitHub Desktop.
RA query to find the age of the oldest person (or people) who eat mushroom pizza. https://stanford.io/2GkWfPx
(
\project_{age}(
\select_{pizza='mushroom'}(Person\join Eats)
)
)
\diff
(
\project_{age1}
(
(
\select_{age1 < age2}(
(\rename_{age1}(
\project_{age}(\select_{pizza='mushroom'}(Person\join Eats))
)
)
\cross
(\rename_{age2}(
\project_{age}(\select_{pizza='mushroom'}(Person\join Eats))
)
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment