For those interested in database query languages, it is worth knowing about Datalog, the query language behind Datomic, XTDB and Datahike: http://www.learndatalogtoday.org/
E.g. a parameterised aggregate query that retrieves the name and average rating of a film starring cast members whose names match the input names:
[:find ?name (avg ?rating)
:in $ [?name ...] [[?title ?rating]]
:where
[?p :person/name ?name]
[?m :movie/cast ?p]
[?m :movie/title ?title]]
To reveal the answer, click on tab labelled "3" and then "I give up!": http://www.learndatalogtoday.org/chapter/7