title: Is it possible to have a MySQL column containing multiple values as foreign keys?
body: <p>I am learning MySQL and have MariaDB installed in Fedora 19.  </p>
  
  <p>I have a scenario where I require a column to contain multiple values in order to reduce possible redundancy of column allocation.  </p>
  
  <p>In the example below, is it possible to have each value in the <code>tags</code> column of the <code>log</code> table reference the <code>tag_id</code> column in the <code>tags</code> table?  </p>
  
  <p><strong>users</strong></p>
  
  <pre><code>user_id        |
  1              |
  </code></pre>
  
  <p><strong>activities</strong></p>
  
  <pre><code>activitity_id  |
  1
  </code></pre>
  
  <p><strong>log</strong></p>
  
  <pre><code>user_id        |    activity_id    | tags
  1              |    1              | 1,3,5 # multiple foreign keys?  
  </code></pre>
  
  <p><strong>tags</strong></p>
  
  <pre><code>tag_id         |
  1              |
  2              |
  3              |
  4              |
  5              |
  </code></pre>
  
  <p>If it is not possible, could anyone provide the logic for the most feasible solution based on the data scenario above?  </p>
  
  <p><strong>Similar Questions:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/7094170/are-multiple-foreign-keys-in-a-single-field-possible">Are multiple foreign keys in a single field possible?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14653893/mysql-foreign-key-having-multiple-conditional-possible-values">MySQL foreign key having multiple (conditional) possible values</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15547276/it-is-possible-to-reference-one-column-as-multiple-foreign-keys">it is possible to reference one column as multiple foreign keys</a></p>