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.

Answers were Sorted based on User's Feedback



Interchange the value of a column Gender in a table where values are Male and Female. So, where th..

Answer / parli jain

Update table_name
set Gender = decode (Gender, 'M', 'F', 'F,'M')
where Gender In ('M','F');

Is This Answer Correct ?    29 Yes 4 No

Interchange the value of a column Gender in a table where values are Male and Female. So, where th..

Answer / raghu

UPDATE TABLE_NAME
SET GENDER=( CASE GENDER
WHEN 'M' THEN 'F'
WHEN 'F' THEN 'M'
END )
WHERE GENDER IN('M','F')

Is This Answer Correct ?    22 Yes 2 No

Interchange the value of a column Gender in a table where values are Male and Female. So, where th..

Answer / 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

Interchange the value of a column Gender in a table where values are Male and Female. So, where th..

Answer / sushma s

Update table_name
Set gender = decode(gender,'M','F','M');

Is This Answer Correct ?    8 Yes 9 No

Post New Answer

More SQL PLSQL Interview Questions

How does an execution block start and end in pl sql?

0 Answers  


What is the difference between pl and sql?

0 Answers  


What does the hierarchical profiler does?

0 Answers  


how can we destroy the cookie? : Sql dba

0 Answers  


What is the syntax to add a record to a table?

0 Answers  






What is difference between sql function and stored procedure?

0 Answers  


Where is pl sql used?

0 Answers  


What is pl sql and why it is used for?

0 Answers  


How many developers work on postgresql?

0 Answers  


how to get a list of all tables in a database? : Sql dba

0 Answers  


How does index help in query performance?

0 Answers  


what are enums used for in mysql? : Sql dba

0 Answers  


Categories