title: How can I implement user-friendly boolean logic in a web form GUI?
body: <p>Currently I have a web application where a user can use dropdown lists to generate SQL SELECT statements like so:</p>
  
  <p>Column Select Dropdown | Operator Dropdown (= != > &lt; &lt;= >=) | Value select dropdown</p>
  
  <p>The user can do this multiple times, and the "filters" are currently all ANDed together.</p>
  
  <p>I want to add the possibility of creating OR statements.  I could very easily add ORs in the case where the columns are the same, but what about complex logic statements like </p>
  
  <p>((A OR B OR C) AND (D OR E)) OR (F AND G)?</p>
  
  <p>How can I let users create such statements in a user-friendly way?</p>
  
  <p>EDIT:  To specify, user-friendly for a general audience.  Currently I work with developers that occasionally hand-code SQL queries for a non-technical client that needs specific information from our database.  The goal is that this web app will remove the need for us to hand-code them by giving the client an easy-to-use tool to do it themselves.</p>
  
  <p>EDIT2:  Currently the app is not being used by end users.  The only data I have as to its use are previous handwritten SQL queries and thus the kind of queries the client asks for.  Given that I could simplify it (e.g. limit the users' ability to generate queries to the kinds of queries they tend to ask for), but I want to see if anybody has experience communicating boolean logic simply and completely in GUIs.</p>
  
  <p>Thank you for your time.</p>