I'm storing a simple tag relationship and I'm wondering what would be the better way to delete tags?
The two ways I know of:
Or simply:
I'm current doing the first method, but the 2nd way seems to be much less of a hassle. But I'm not sure if it's "bad" or inefficient to use delete in this fashion. Or if you have a better method feel free to share.
You could adjust the first method to do also not do the inserts on tags that already exist. But it could (and probably will) still result in more queries then the second method, especially if you combine those insert statements in a single query.
//small example :)
INSERT INTO content_tags
(content_id, tag_id)
VALUES
(1,1),
(1,2),
(1,3);