I find using procedures for these tasks to be much easier than requiring users to wrap their head around the nested set model or to try and translate the code to the language in your client.
InsertingOne item missing from the blog is the actual code, sure it gives you snippets but not the entire picture. For example inserting nodes is different if you are dealing with a leaf or internal node. Just a small oversight that I thought I would resolve by creating a procedure. It takes as input the id of the parent node that we want to insert and we pass the values for the new node. The procedure tests if the parent is a leaf node and branches accordingly.
To call the procedure we will need the id of the parent node and values. For example if we were to add a node for smartwatches to the PORTABLE_ELECTRONICS that has an id of 6 we can call the procedure like this:
DeletingThis one is pretty easy. We take as input the id of the node we want to delete.
To call the procedure we just need the id of the node. For example if we decided that CD players were now obsolete we can delete the node "CD PLAYERS" which has an id of 9.