ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Databases  >>  SQL PLSQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
If I have a table T with 4 rows & 2 columns A & B. A has
values 1,2,3,4. and B has 10,20,30,40. Write an Update SQL
query which can Swap the values of A & B for all records.
(Do not use a sub-query)
 Question Submitted By :: Akj504
I also faced this Question!!     Rank Answer Posted By  
 
  Re: If I have a table T with 4 rows & 2 columns A & B. A has values 1,2,3,4. and B has 10,20,30,40. Write an Update SQL query which can Swap the values of A & B for all records. (Do not use a sub-query)
Answer
# 1
UPDATE T
  SET A = B,   ENVDOR_NUMBERB = A
 
Is This Answer Correct ?    0 Yes 0 No
Amit
 
  Re: If I have a table T with 4 rows & 2 columns A & B. A has values 1,2,3,4. and B has 10,20,30,40. Write an Update SQL query which can Swap the values of A & B for all records. (Do not use a sub-query)
Answer
# 2
UPDATE T
  SET A = B,B=A;

I am surprized but above query will fetch the desired 
result.

Cheers,
Bunty
 
Is This Answer Correct ?    6 Yes 0 No
Bunty
 
 
 

 
 
 
Other SQL PLSQL Interview Questions
 
  Question Asked @ Answers
 
what is julian date in oracle  1
how to retrieve the top 3 salaries of the table using rownum Oracle15
What is a cursor for loop ?  2
diff b/w sub query and co-relater query? iFlex3
SELECT emp_num, years, SUM(salary) FROM sales UNION ALL SELECT emp_id, SUM(takehomepay) FROM marketing What error is present in the sample code above? 1. Queries being combined with the UNION ALL statement are not allowed to have SELECT lists with a different number of expressions. 2. You are not allowed to use aggregate functions within two queries joined by a UNION ALL statement. 3. The UNION ALL statement incorrectly combines the "years" result from the first query with the "SUM (takehomepay)" result from the second query. 4. Unless the UNION ALL statement is replaced with a UNION statement, the queries will return duplicates. 5. The "emp_id" column from the second query must be renamed (or aliased) as "emp_num" so that it corresponds to the column name from the first query. Otherwise, the queries will not execute.  3
State the difference between implict and explict cursor's?  4
what is sql and plsql  4
What is normalization and types of normalization? Microsoft3
Differentiate between %type and %rowtype attribute in Oracle PL/AQL programming ? PreVator3
How to get the procedure's, function's name from a package if it is wrapped(both spec & body).  1
What is TABLE SPACE? ABB2
What is a transaction?  4
What is difference between triggers and stored procedures. And advantages of SP over triggers ? TCS2
if i perform any operation on views such as insert, delete etc will my base table get affected?????  3
What is difference between % ROWTYPE and TYPE RECORD ?  2
use of IN/ANY/ALL Ramco3
what is global table iFlex5
what is the difference between granting and creating a view?  1
What is referential integrity ? BirlaSoft2
will function return more than one value how Accenture4
 
For more SQL PLSQL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com