Currently I have a web application where a user can use dropdown lists to generate SQL SELECT statements like so:
Column Select Dropdown | Operator Dropdown (= != >
Apple seems to have found a way to design a GUI for nested boolean expressions: see the accepted answer on UX.stackexchange.