title: How to represent a logical model in a database?
body: <p>I will do my best to explain my current problem:</p>
  
  <p>Imagine I have something like this: </p>
  
  <p><code>(a and b(c or d))</code></p>
  
  <p>where <code>a,b,c</code> are all of the same type.</p>
  
  <p>I would like to </p>
  
  <p>a) store the information in a DB (SQLSERVER)
  b) recreate the above based on the stored data.</p>
  
  <p>I guess my question is..How do I represent in a DB similar types that can be connected to one another through the use of ANDs and ORs pairwise, and can also be nested in parenthesis.</p>
  
  <p>The best thought I had was save the info as a string, replacing <code>a,b,c</code> with their respective DB IDs, and then when information is pulled from the DB, replace the IDs with the  actual items and evaluate on the spot.</p>
  
  <p>I guess I wonder if there's a better practices way. Sorry if this isn't clear, not a DB expert - did my best to explain !</p>
  
  <p><em><strong></em> UPDATE **</strong>
  think of A, B, etc, to be foreign keys to function types that, when run, return any of three values : True, False, N/A. I am trying to think of a way to pair a number of such functiontypes together, through the use of ANDs, ORs, and brackets. I do not think it's easily done with tables though :(</p>