Is it possible without any forms of
eval or stored procedures to execute a query, which interprets logical expression, encoded in some way in a table (or two tables) of relational database?
For example, one table can contain a mapping for variable names into their truth values (V1), and another table or two (L1 and L2) - encode logical expressions, eg, in a conjunctive normal form.
Then some clever SQL query will interpret the logical expression from L1-L2, and apply values for variables from V1. (And of course same can also be done for multiple different expressions in the same query).
At first, this seems non-trivial to construct, but SQL has aggregating functions, so theoretically should be possible?