Skip to content

Instantly share code, notes, and snippets.

@JLLeitschuh
Created February 9, 2021 23:38
Show Gist options
  • Save JLLeitschuh/f01c8369775113a0dd5671e2a3acfe50 to your computer and use it in GitHub Desktop.
Save JLLeitschuh/f01c8369775113a0dd5671e2a3acfe50 to your computer and use it in GitHub Desktop.
import tutorial
from Person t
where t.getHeight() > 150 and
t.getHairColor() != "blond" and
exists (string c | t.getHairColor() = c) and
t.getAge() >= 30 and
t.getLocation() = "east" and
(t.getHairColor() = "black" or t.getHairColor() = "brown") and
not (t.getHeight() > 180 and t.getHeight() < 190) and
not t = max(Person p | | p order by p.getAge()) and
not t = max(Person p | | p order by p.getHeight()) and
t.getHeight() < avg(Person p | | p.getHeight()) and
t = max(Person p | p.getLocation() = "east" | p order by p.getAge())
select t, "is " + t.getHeight() + " units tall", "and is " + t.getAge() + " years old"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment