q/kdb+ | Functional query form
Although it is possible to perform table queries in kdb using a SQL-like query form [1], when performing more programmatic work beyond exploratory analysis, it will often be necessary to specify table names and columns through variables rather than direct naming, which is not possible in the regular qSQL form. To do this, the functional form of queries [2] must be used.
The functional form is both powerful and concise, but the tradeoff is that it does have a significant difficulty curve. Q for Mortals has a queries chapter [3] that provides usable examples that can serve as templates for more complex queries.
Resources: