title: On delete cascade alternate
body: <p>I am trying to create a database for child and parent. Tables looks like.</p>
  
  <blockquote>
    <p><strong>ChildTable</strong>  :  <em>child-id</em>(pk) | <em>parent-id</em>(fk) | <em>name</em></p>
    
    <p><strong>ParentTable</strong> : <em>parent-id</em>(pk) | <em>name</em></p>
    
    <p><strong><em>FOREIGN KEY ParentTable(parent-id) REFERENCES  ChildTable(parent-id) ON DELETE CASCADE</em></strong></p>
  </blockquote>
  
  <p><strong>Problem:</strong>  a parent can have more than one children and parent table is dependent on child table. If a parent is having two children and we delete one children record from <em><strong>ChildTable</strong></em> it would delete the parent as well while parent record must exist for another child whose record is still in database.</p>
  
  <p>Is there any other MySQL method/constraint that can fulfill the above requirement.</p>
  
  <p>Thanks in advance.</p>
  
  <blockquote>
    <p><strong>Update:</strong> I would like to explain my problem in detail.</p>
  </blockquote>
  
  <p>I want to apply following rules to the database:</p>
  
  <ul>
  <li>A record in parent table must be always dependent of any one or two records in child table. (FK was added for the same.)</li>
  <li>There is possibility that 2 children can point to same parentID</li>
  <li>if we delete one child having parentID (say 'abc') then parent id must not be deleted if there exists another child having same parentID.</li>
  <li>on deleting the second child with same parentID('abc') now it must be deleted as there is no child with parentID('abc').</li>
  </ul>