There is a table which contains all the employee details,
unfortunately there is mistake occured while entering the
data.
ex:
-------------------------------
empid empname gender address
-------------------------------
1 abcd f address1
2 defg m address2
3 ghth m address3
4 jkil f address4
write a update query that will change gender 'm' to 'f'
and 'f' to 'm'

Answers were Sorted based on User's Feedback



There is a table which contains all the employee details, unfortunately there is mistake occured w..

Answer / guest

update employeedetails
set gender='m'
where gender='f'
update employeedetails
set gender='f'
where gender='m'

Is This Answer Correct ?    2 Yes 2 No

There is a table which contains all the employee details, unfortunately there is mistake occured w..

Answer / shahbaz maqsood

It isn't possible to me to write a single query.You can first assign another value like 'a' to one of two values.Then assign your required value to the other

"update table set gender='f' where gender='m'"

"update table set gender='m' where gender='a'"

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Programming Languages AllOther Interview Questions

if there are n nodes in a binary tree, how many null pointers are there?

4 Answers   Hughes,


how we can know the funcions available in a class recording java?

0 Answers  


Why COBOL/400 is giving 95 session error when opening a file even though the file is having key and the screen or display file is having IND ARA defined?

1 Answers   Freelance,


If u need any fake experience certificate in software side, contact me at: vikramyadhav@gmail.com

0 Answers  


what is diff bet ref variable & instance of class

0 Answers  






can we extend a class having only one parameterised constructor.Suggest the process to do it.

0 Answers   Zensar,


why we use mantis? what u mean mantis in IT trends? addvantages of mantis?

0 Answers   HCL, Sacred Heart College,


EXPLAIN UNARY OPEARATORS

0 Answers  


What is the Difference between in memory database and physical database

0 Answers  


Difference between HTML and DHTML?

0 Answers  


which property is used to display the advertisements with adrotator control

0 Answers   Sonata,


What is the effect of the OPTIONS statement ERRORS=1?

3 Answers   QSG, Quintiles, SAS,


Categories