title: How to apply 3-valued-logic to SQL queries?
body: <p>I've been doing past paper questions and keep coming up against these questions that deal with 3 valued logic.  My notes mention it but don't give examples that relate to those asked in exams.  </p>
  
  <p>I understand the basis that <code>True = 1</code>, <code>False = 0</code> &amp; <code>Unknown = 1/2</code> as well as <code>And = Min</code>, <code>Or = Max</code> and <code>Not(x) = 1-x</code>.  However I do not know how to apply it to questions such as those below:</p>
  
  <blockquote>
    <p>In SQL, discuss the possible truth values of the following expression:<br>
    R.a > R.b OR R.a &lt;= 0 OR R.b >= 0<br>
    Justify your answer.</p>
  </blockquote>
  
  <p>And:</p>
  
  <blockquote>
    <p>The phone and age fields of the Owner table might have null values in
    them. Considering all possible combinations, show which of the three
    truth values might be returned by the expression:<br>
     phone = ’141-3304913’ OR age &lt;50 OR age >= 50</p>
  </blockquote>
  
  <p>Any help in clarifying these for me would be really appreciated :)</p>