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

When using the Pager object, inorder to know which page to go, which property you have to set to grid?

557


How can I create master page in asp net?

503


Define common type system?

576


Can you explain how ASP.NET application life cycle and page life cycle events fire?

562


Name the two properties are on every validation control?

536






What is a response cookie?

603


Explain the Session state management options available with ASP.NET?

560


What are sql notifications and sql invalidations?

525


What is the difference between dispose() and finalize()?

491


Define web services in asp.net.

551


Define tracing.

618


What is meant by asp.net?

531


How do I send an email message from my ASP.NET page?

524


Which is better viewstate or session?

511


Why do we use asp.net?

578