If you are doing this in a GUI plugin then dont use the db API directly, instead use the existing remove books action which will take care of refreshing the GUI for you automatically. Something like:
Code:
self.gui.iactions['Remove Books'].remove_format_by_id(book_id, fmt)
Note however, that this function will ask the user for confirmation. If you want to avoid that, then look at its code and re-implement it yourself, you will find it in actions/delete.py