title: SQL keys, MUL vs PRI vs UNI
body: <p>What is the difference between <code>MUL</code>, <code>PRI</code> and <code>UNI</code> in MySQL?</p>
  
  <p>I'm working on a MySQL query, using the command:</p>
  
  <pre><code>desc mytable; 
  </code></pre>
  
  <p>One of the fields is shown as being a <code>MUL</code> key, others show up as <code>UNI</code> or <code>PRI</code>.</p>
  
  <p>I know that if a key is <code>PRI</code>, only one record per table can be associated with that key. If a key is <code>MUL</code>, does that mean that there could be more than one associated record?</p>
  
  <p>Here's the response of <code>mytable</code>.</p>
  
  <pre><code>+-----------+---------+------+-----+---------+-------+
  | Field     | Type    | Null | Key | Default | Extra |
  +-----------+---------+------+-----+---------+-------+
  | courseid  | int(11) | YES  | MUL | NULL    |       | 
  | dept      | char(3) | YES  |     | NULL    |       | 
  | coursenum | char(4) | YES  |     | NULL    |       | 
  +-----------+---------+------+-----+---------+-------+
  </code></pre>