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

Can a procedure in a package be overloaded?

0 Answers   EXL,


What does over partition by mean in sql?

0 Answers  


What is the difference between local and global temporary table?

0 Answers  


Is sql free?

0 Answers  


how to create a database in oracle?please gve anser with example

1 Answers  






in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

0 Answers  


What is normalisation in sql?

0 Answers  


What is Referential Integrity?

3 Answers  


Query for second maximum salary in each in each department

15 Answers   DST Global Solutions, TCS,


wa procedure to return the month and the no'f developers joined in each month.

4 Answers   Fidelity,


What is the difference between a primary key and a unique key?

0 Answers  


what is self join and why is it required? : Sql dba

1 Answers  


Categories