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   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 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
write down the sql query?

Table Name : emp1
empid empname
1      bala
2      guna

Table Name : emp2
empid   empname
1         <Null>
2         <Null>

Solution : emp1 names are updated in emp2, write a query?

 Question Submitted By :: T.balasubramanian
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?
Answer
# 1
update w set w.ename=q.ename from empn1 w,
(select e.ename,e.empid from empn e,empn1 a where 
a.empid=e.empid) q where w.empid=q.empid
 
Is This Answer Correct ?    0 Yes 0 No
Saravanan
 
  Re: write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?
Answer
# 2
update e2 set e2.empname = e1.empname
from emp2 e2,emp1 e1
where e1.empid = e2.empid
 
Is This Answer Correct ?    2 Yes 0 No
Dhana
 
 
 
  Re: write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?
Answer
# 3
update emp2 set empname =e.empname from emp1 e where 
e.empid =emp2.empid
 
Is This Answer Correct ?    0 Yes 0 No
Vidya
 
  Re: write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?
Answer
# 4
Update emp2 set empname = (Select empName from emp1 where
emp2.empid =emp1.empid)
 
Is This Answer Correct ?    2 Yes 0 No
A
 
  Re: write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?
Answer
# 5
Update e2
      set e2.empname=e1.empname
from
     emp2 e2 inner join emp1 e1 on e1.empid=e2.empid
 
Is This Answer Correct ?    0 Yes 0 No
Rajesh.a
 
  Re: write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?
Answer
# 6
update e2 
set e2.name= e1.name
from emp2 e2 
join emp1 e1 on e1.id=e2.id
 
Is This Answer Correct ?    0 Yes 0 No
Pradip Jain
 
  Re: write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?
Answer
# 7
Insert in to emp2 values as select * from emp1;
 
Is This Answer Correct ?    1 Yes 0 No
Rafi
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is Query Execution Plan? How does it help optimize or tune a database driven application? Accenture2
to explain sql server 2000 architecture & authentication  1
can anyone explain me the concept of Serialization in Detail and Clear? plz its urgent i have interview on friday (15th feb)  1
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE? Yardi-Software4
How to perfor If the table running time is taking 2hours and table is having 10 rows in it?  1
hi, how to match retrieve the unmatched records from 2 tables in which we dont have any primary key. example : table1 has 1,2,3,4,5 and table2 has 1,2,3,4,5,6,7,8,9,10 and i want the numbers from 6 to 10 to be displayed and should not come as null. i need the numbers. please reply as soon as possible.  2
how do we find every fifth record in a table  11
Define candidate key, alternate key, composite key.  9
What is an execution plan? When would you use it? How would you view the execution plan?  1
write down the code for "how we delete a table without using of Drop command " ? Sonata2
What is the purpose of using COLLATE in a query?  1
How to restart SQL Server in single user mode? How to start SQL Server in minimal configuration mode?  1
What is the difference between distinct clause and group by clause? Value-Labs1
Explain Trigger with an example?  1
select top 5 * from emp order by newid() my question is , how this query get executed?  4
What is RAID and what are different types of RAID configurations? Wipro5
1.How to check the backup file details if we do not have access to that folder 2.how to check the backup file size without connecting to the folder IBM1
What are defaults? Is there a column to which a default can't be bound?  2
I have a website that allows customers to browse and place orders for certain products. I have 2 tables; Customers and Orders. The Customers table holds the customer records and the Orders table holds the orders placed by the customer. Both tables are tied based on the field Cust_ID. Example of the data is shown below: Cust_ID Cust_Name Cust_ID Product Amount Order_Date 1001 John Tan 1001 P-5211 $120.00 2/13/2006 1002 Michael Wong 1001 K-1428 $88.90 1/11/2006 1003 Mary Cheong 1003 C-0923 $82.50 1/27/2006 1004 Ahmad Suffian 1003 K-1428 $88.90 2/2/2006 Write a single SQL statement that extracts all purchase records with the following criteria: 1. Customer names starting with “M” only. 2. Orders placed within the current month only. 3. Amount does not exceed $100.00 The list must be sorted by order date with the latest order showing on top. Techno-Solutions3
write the query for taking database backup in sql Logica-CMG6
 
For more SQL Server 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