WordPress: SQL query to set TAG or CATEGORY if 1 or more words are written in post_title

SQL
I need to set the TAG or CATEGORY in a post if there is a keyword in the post_title. Eg:
IF “abc” word in post_title THEN set post TAG to “zzz”
or
IF “abc” word in post_title THEN set post CATEGORY to “pluto”
thanks