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 Posted / vicky

update emp2 e2 set e2.empname = (select e1.empname from
emp1 e1 where e2.empid=e1.empid)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Will sql server 2005 allow you to reduce the size of a column?

555


How to perform backup for certificates in sql server? : sql server security

597


Tell me what is difference between clustered and non clustered index?

560


Is it possible to call a stored procedure within a stored procedure?

558


State the difference between local and global temporary tables?

568






How can I create a report based on a query? : sql server management studio

564


List the various tools available for performance tuning?

488


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1124


Do you know sql server 2008 backup compression?

568


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

2020


What does truncate do?

533


What is the cartesian product of the table?

552


What are the limitations/drawbacks or ssrs 2008 r2?

86


What are relationships and mention different types of relationships in the dbms

560


What is dbcc command in sql server?

589