title: Deleting from a database map
body: <p>I have these 3 tables + data:</p>
  
  <p><strong>items</strong>: itemId, itemName
  <br />data: 1, my item one</p>
  
  <p><strong>categories</strong>: catId, catName
  <br />data: 1, my cat one. 2, my cat two</p>
  
  <p><strong>map</strong>: mapId, itemId, catId</p>
  
  <p>When you include item "my item one" in category "my cat one", you insert [1, 1, 1] into the map. When you add "my item one" to "my cat two", you insert [2, 1, 2] into the map. Now let's say we change our mind and only want the item in "my cat two". This means we need to know what categories the item is no longer in and delete the associations from the map. What's the most efficient sequence of steps to take to do so? (I'm looking for a solution that will scale beyond this trivial example.)</p>