What does the following SQL statement return, assuming that
all tables and column names are correct?
SELECT FirstName, StreetAddress
FROM Employees
JOIN AddressBook
ON Employees.EmpID = AddressBook.EmpID

a) Nothing, the JOIN syntax is wrong.
b) All the records form the Employees table, and only the
matching ones form the StreetAddress table.
c) All the records from the StreetAddress table and only the
matching records form the Employees table.
d) Only the matching records from the two tables.

Answer Posted / shikhar

I think the state ment above should return the records from
matching records from two talbes since the JOIN state ment
specifies the middle element..i.e employee...let us see how
it works..
lets say we hav two elemt rows( here i am taking the only
one column from each table since it would provide us with
the required understanding....)

employees addressbook
---------- ------------
EMP_NAME EMP_NAME
-------- -----------
ram raju
raj harish
ravi hani
rohit jitender
raju fina
manish kittu

now when these two statements are joined ,first of all the
first state ment is scanned and its first element i.e 'ram'
is matched againest the all the element of thhe other list
i.e addressbook...if it finds the name 'ram' in addressbook
it will select it as a part of the result otherwise it just
looks move on to another one thats 'raj'...n one important
thing ... in case 'ram' finds the match in the addressbook
twice...it will not take bothe of them .....it will skip
all the others and move on to the next row....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which object encapsulates state or data of a user?

624


What's the use of response.output.write()?

758


What is the exact purpose of http handlers?

566


To display data in the combo box, prior to setting the Data Source, what kind of property on a Combo Box do you set with a column name?

601


what is a .xap file? Explain with an example.

585






Explain how caching in asp.net 2.0 is different from caching in asp.net 1.1?

536


What is __ requestverificationtoken?

551


A web service can only be written in .net? State whether true or false.

536


When does a session actually start?

565


What are user controls?

566


What is a web pool?

580


Explain the overview of asp.net?

558


What are the HTML server controls in ASP.NET?

571


Explain model, view and controller represent in an mvc application? : asp.net mvc

510


What is Web API?

645