Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


id name gender
1 Ram Female
2 Kumar Female
3 sathish Female
4 Santhya Male
5 Durga Male
6 Priya Male

This is my input...how to change Gender Male to Female &
Female to Male??? Write sql query for this question???

Answers were Sorted based on User's Feedback



id name gender 1 Ram Female 2 Kumar Female 3 sathish Female 4 San..

Answer / yuvaevergreen

I am not sure whether decode will work in teradata 12.0 but case statement can be used.

update stud set gender =
case gender
when 'male' then 'female'
when 'female' then 'male'
end;

Is This Answer Correct ?    24 Yes 1 No

id name gender 1 Ram Female 2 Kumar Female 3 sathish Female 4 San..

Answer / ankal

update stud set gender=
case gender when'male' then'female'
else 'male' end;

Is This Answer Correct ?    7 Yes 0 No

id name gender 1 Ram Female 2 Kumar Female 3 sathish Female 4 San..

Answer / kumar amit ranjan

UPDATE stud SET gender ='Z' WHERE gender ='F';
UPDATE studmaster SET gender ='F' WHERE gender ='M';
UPDATE studmaster SET gender ='M' WHERE gender ='Z';

Is This Answer Correct ?    3 Yes 2 No

id name gender 1 Ram Female 2 Kumar Female 3 sathish Female 4 San..

Answer / tdguy

update using case option is the best option for this query.

Is This Answer Correct ?    1 Yes 0 No

id name gender 1 Ram Female 2 Kumar Female 3 sathish Female 4 San..

Answer / srinu

update stud set gender= decode(gender,'M','F','F','M')

Is This Answer Correct ?    3 Yes 3 No

id name gender 1 Ram Female 2 Kumar Female 3 sathish Female 4 San..

Answer / apurva kumar

UPDATE table
SET Gender = CASE
WHEN Gender = 'Male' THEN 'Female'
ELSE 'Male'
END

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Teradata Interview Questions

Can you fastexport a field, which is primary key by putting equality on that key?

0 Answers  


What are the uses of client software involved in teradata?

0 Answers  


What is spool space? Why do you get spool space errors? How do trouble-shoot them?

0 Answers  


What is SQL Assistence?please eample

4 Answers   IBM,


what is differences between Fastload and Multiload as per DBA aspect ?

1 Answers   Wipro,


Backup Script was blocked you are unable to archive the data now. how do you analyze it and where do you identify ?

0 Answers  


Explain Teradata performance tuning and optimization?

0 Answers  


Hi frnds...can any one help me regarding this que.. We have column in a table name it as C1 WHICH CONTAIN ALPHANUMERIC AND NUMERIC VALUES. C1 2A 2B 2V 2H 1 2 3 4 5 i want to retrive numeric values like 1,2,3,4,5 How we can get Plz let me know.Thanks in advance

4 Answers   IBM,


Give a justifiable reason why Multi-load supports NUSI instead of USI.

0 Answers  


How teradata makes sure that there are no duplicate rows being inserted when its a set table?

0 Answers  


Can some one tell me the ressolution for the error. I was not able to answer this question in wipro interview. "The transaction exceeded the maximum number of rowhash locks allowed"

1 Answers   Wipro,


Mention a few of the ETL tools that come under Teradata.

0 Answers  


Categories