title: MYSQL foreign key to the same table?
body: <p>I have a table with following columns: "<code>id</code>, <code>parent_id</code>, <code>name</code>" , where <code>parent_id</code> points to a entity in the same table. </p>
  
  <p>I want to add a constraint that stops me from deleting an entity, if there are other entities, that have the first one as <code>parent_id</code>.</p>
  
  <p>Can a foreign key be used for this or is foreign key only allowed to point to other tables?</p>