title: Foreign keys and NULL in mySQL
body: <p>Can I have a column in my values table (value) referenced as a foreign key to knownValues table, and let it be NULL whenever needed, like in the example:</p>
  
  <p>Table: values</p>
  
  <pre><code> product     type     value     freevalue
   0           1        NULL      100
   1           2        NULL      25
   3           3        1         NULL
  </code></pre>
  
  <p>Table: types</p>
  
  <pre><code> id    name     prefix
   0     length   cm
   1     weight   kg
   2     fruit    NULL
  </code></pre>
  
  <p>Table: knownValues</p>
  
  <pre><code>id    Type     name
  0     2        banana 
  </code></pre>
  
  <p>Note: The types in the table <code>values</code> &amp; <code>knownValues</code> are of course referenced into the <code>types</code> table.</p>