|
|
NEW INTERVIEW QUESTIONS.COM
MICROSOFT INTERVIEW QUESTIONS
ADO.NET INTERVIEW QUESTIONS DETAILS
NewInterviewQuestions.com - Home for World's Largest Interview Questions Website.
A D V E R T I S E M E N T
Question |
There are 2 tables, Employee and Department. There are few records in employee table, for which, the department is not assigned. The output of the query should contain all th employees names and their corresponding departments, if the department is assigned otherwise employee names and null value in the place department name. What is the query?
|
Answer
|
Use an ouer join to get your query.
Select E.ENAME, D.DNAME
from Employee E, Dept D
where D.DEPTNO (+)= E.DEPTNO
simply saying datareader is forward only where as dataadapter is not.
datareader gives only one row and datadapter gives multiple rows.
by this the inteviewer will be happy
Answered By: pasha Date: 4/10/2007
Data Reader is used in read the database. Data Adapter is used in data base concept.
Answered By: vijay kumar Date: 4/20/2007
Select E.ENAME, D.DNAME
from Employee E
left outer join Dept D on (D.DEPTNO = E.DEPTNO )
Answered By: Vinod Tejnani Date: 1/22/2008
select empname,deptname from employee right outer join department
on employee.deptno=department.deptno
Answered By: seema sonawane Date: 4/22/2008
select empname,deptname from employee right outer join department on employee.deptno=department.deptno
Answered By: Nilesh Date: 6/11/2008
Select Employee.*, Department.* from Employee LEFT OUTER JOIN Department ON Employee.EmpId=Department.DeptId
Answered By: Sushma Date: 11/11/2008
© NewInterviewQuestions.com
|
If you have the better answer, than send it to us. We will display your answer after the approval.
Rate the above answer. Help us to know about the answer.
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
A D V E R T I S E M E N T
|
|
|