create or replace function demo(p, q) as table ( select p as p, q as q, p and q as and, p or q as or, not p as "NOT p", (p is TRUE) as "p is TRUE", (p is NULL) as "p is NULL" ); # Some examples from demo(0, 0) union all from demo(0, 1) union all from demo(true, true) union all from demo(0, null) union all from demo(1, null) union all from demo(null, null);