title: Setting up table relations what do "Cascade", "Set Null" and "Restrict" do?
body: <p>I want to start using table relations in a new project.</p>
  
  <p>After some googling I got 2 tables set up as InnoDB:</p>
  
  <p>The keys I want to link are</p>
  
  <p>->users->userid (primary)
  ->sessions->userid (index)</p>
  
  <p>The only thing that I don't understand in this process is what the different settings for "On update" and "On delete" do</p>
  
  <p>The options here are:</p>
  
  <ul>
  <li>-- (nothing?)</li>
  <li>Cascade (???)</li>
  <li>Set Null (sets everything to null?)</li>
  <li>No action (well duh...)</li>
  <li>Restrict (???)</li>
  </ul>
  
  <p>I basically want the data in sessions to be deleted when a user is completely deleted
  This since the sessions will only be deleted when the expiration is detected by my session manager...</p>
  
  <p>So if anyone can tell me what these options do it would be much appreciated.</p>