Interchange the value of a column Gender in a table where
values are Male and Female. So, where the value is Male, it
should changed to Female and Female to Male.
Answer Posted / ram
UPDATE TABLE
SET GENDER=(CASE GENDER
WHEN 'M' THEN 'F'
WHEN 'F' THEN 'M'
END) WHERE GENDER IN ('M','F')
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a join?
What are the usages of sql?
What are the different dcl commands in sql?
Is big data nosql?
What is the use of <> sql?
How do you copy a table in sql?
What is example of database?
Can we create table inside stored procedure?
Why do we use sql constraints? Which constraints we can use while creating database in sql?
How is data stored in sql?
Difference between truncate, delete and drop commands?
How do I run a pl sql program?
what are date and time data types in mysql? : Sql dba
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
How does a trigger work?