5 Different Solutions
IF \n\nUPDATE Salary\nSET sex = IF(sex="f", "m", "f") ;\n\n\n2. XOR\n\nUPDATE Salary\nSET sex = CHAR(ASCII(\'f\') ^ ASCII(\'m\') ^ ASCII(sex)) ;\n\n3. CASE\n\nU
1. IF \n```\nUPDATE Salary\nSET sex = IF(sex="f", "m", "f") ;\n```\n\n2. XOR\n```\nUPDATE Salary\nSET sex = CHAR(ASCII(\'f\') ^ ASCII(\'m\') ^ ASCII(sex)) ;\n```\n3. CASE\n```\nUPDATE Salary\nSET sex = (\n    CASE\n        WHEN sex="f" THEN "m"\n        ELSE "f"\n    END\n)\n```\n4. REPLACE \n```\nUPDATE Salary\nSET sex = REPLACE (\'fm\', sex, \'\');\n```\nExplanation : \nThis is the syntax of REPLACE() :\n`REPLACE(string, char_to_find, char_to_replace)`\nIt finds `char_to_find` in `string` and replace that character with `char_to_replace`\n\nThe `sex` column can have only values `f` and `m` . \nSo `REPLACE(\'fm\', \'f\', \'\')` replace `f` with blank string in `fm` , basically removing `f`.\n`REPLACE(\'fm\', \'f\', \'\') is m` and, \n`REPLACE(\'fm\', \'m\', \'\') is f` .\n\n(PS : I am not sure if is allows you to find and replace whole substrings and I am too lazy to check it  :) )\n\n5. ASCII Values\n```\nUPDATE Salary\nSET sex = CHAR(ASCII(\'f\') + ASCII(\'m\') - ASCII(sex));\n```\n
[]