<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>

Assuming you've already got the category ID for "my cat two" and the item ID for "my item 1":
```
```
DELETE FROM MAP WHERE ItemID = @MyItem1Id
                AND CatID <> @MyCat2Id
```
```
If you have a set of categories you want to keep the item in, you could either:
Delete everything from the map for that item and then re-add the set
Use a query like the above but with "AND CatID NOT IN [ ... ]"