title: Exact Meaning of MySQL's Foreign Key 'on delete restrict' Clause
body: <p>I have two MySQL tables: <code>collections</code> and <code>privacy_level</code>.<br>
  I define them with a <strong>foreign key</strong> relationship as such:</p>
  
  <pre><code>CREATE TABLE collections (
    coll_id smallint NOT NULL AUTO_INCREMENT UNSIGNED,
    name varchar(30) NOT NULL,
    privacy tinyint NOT NULL UNSIGNED DEFAULT '0',
    PRIMARY KEY(coll_id),
    INDEX(privacy),
    FOREIGN KEY fk_priv (privacy) REFERENCES privacy_level (level) ON UPDATE CASCADE ON DELETE RESTRICT
  ) ENGINE=InnoDB;  
  
   CREATE TABLE privacy_level (
     level tinyint NOT NULL UNSIGNED,
     name varchar(20) NOT NULL,
     PRIMARY KEY (level)
   ) ENGINE InnoDB;  
  </code></pre>
  
  <p>My question is about the <code>ON DELETE RESTRICT</code> clause and I couldn't derive the answer from the online manual or a google search.</p>
  
  <p>Does this mean that I can <strong>never</strong> delete a row from <code>privacy_level</code>?<br>
  Or, does it mean that I <strong>can't</strong> delete a row from <code>privacy_level</code> <strong>if</strong> a row from <code>collections.privacy</code> has a value that is the same as a value in <code>privacy_level.level</code>? </p>
  
  <p>That is, if <code>privacy_level</code> has <code>level = 2</code>, <code>name = 'top secret'</code> but no entry in collections.Privacy has <code>privacy = 2</code>, can I delete the <code>level = 2</code>, <code>name = 'top secret'</code> entry? Or is it forbidden on a column wide basis?  </p>
  
  <p>Thanks for any insight.</p>