title: Add and/or delete records from SQL DB
body: <p>Good day everyone, I have a situation where there is a selectable list of items on a website where each selected item has a record in a mySQL table:</p>
  
  <pre><code>parentID BIGINT NOT NULL
  childID BIGINT NOT NULL
  </code></pre>
  
  <p>The 'parentID' is the ID of the record that the 'childID' belongs to, so the DB may contain something like:</p>
  
  <pre><code>2 | 13
  4 | 8
  4 | 10
  4 | 7
  </code></pre>
  
  <p>This would indicate that the #4 record has three records associated with it (7,8,10).  Now let's say that the user selects another item in the list on the website (e.g. record 9), but also unselects record 7, what is the best practice to delete record 7 from the list while adding record 9?  I've looked at using 'NOT IN' statements (without success) and 'NOT EXIST' statements (but didn't implement), but figured I'd ask here before spending too much time on something that can be done much better than my own design.</p>
  
  <p>Dave</p>