If you just delete a tag in the database, you will need to purge some caches. Why not just using the API functions?
General developer forum
Help, moodle 3.3 NOT DELETING FROM THE DATABASE
This discussion has been locked so you can no longer reply to it.