Replace function used
Intuition\nSyntax for Replace():\n\nreplace(string,to_be_replaced,replaced_by)\n\nHere we gave fm as string if sex=f then we will replace f of fm with \'\' so i
# Intuition\n**Syntax for Replace():**\n\n`replace(string,to_be_replaced,replaced_by)`\n\nHere we gave fm as string if `sex=f` then we will replace `f` of `fm` with `\'\'` so it will be simply` m`.\nsimilarly, \nif `sex=m` then we will replace `m` by `\'\'` and hence our string will become `f`\nso the replace() function here is working as the conversion of `f` as `m` and `m` as `f`.\n\n\n# Code\n```\n# Write your MySQL query statement below\nupdate salary set sex=replace(\'fm\',sex,\'\');\n```
['MySQL']