Functions are reusable queries or query parts. Functions can be stored as database entities (similar to, for example, tables) called stored functions. Functions can also be created in an ad-hoc fashion inside queries using a let statement through a mechanism called lambda expressions.
See user-defined functions for additional details on the function invocation syntax and rules. Details on how to create and manage store functions can be found under managing functions.