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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
What is the difference between IN and EXISTS operators in
SQL Server?
 Question Submitted By :: Durga Prasad
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between IN and EXISTS operators in SQL Server?
Answer
# 1
using the IN clause, you're telling the rule-based 
optimizer that you want the inner query to drive the outer 
query (think: IN = inside to outside). 

When you write EXISTS in a where clause, you're telling the 
optimizer that you want the outer query to be run first, 
using each value to fetch a value from the inner query 
(think: EXISTS = outside to inside). 

Thank you
 
Is This Answer Correct ?    6 Yes 1 No
Vijaykumar Dolli
 
  Re: What is the difference between IN and EXISTS operators in SQL Server?
Answer
# 2
HERE'S THE SIMPLE ANSWER:
WHEN YOU USE 'IN', WHILE CHECKING FOR WHERE CONDITION SQL 
SERVER ENGINE DOES WHOLE TABLE SCAN.
IF YOU USE 'EXISTS' AS SOON AS ENGINE FINDS THE REQUIRED 
ROW IT WILL STOP EXECUTING QUERY AND GOING FURTHER SCANNING 
TABLE. 

SO BASICALLY EXISTS IS FASTER AS COMPARED TO IN.
 
Is This Answer Correct ?    12 Yes 0 No
Monal
 
 
 
  Re: What is the difference between IN and EXISTS operators in SQL Server?
Answer
# 3
IN work like a OR in sql query but in is faster than OR in 
case of IN server will search whole table
EXISTS is use to find the required row  and does not search 
whole table
 
Is This Answer Correct ?    3 Yes 0 No
Navneet Sharma
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
Which system table contains information on constraints on all the tables created?  2
Can you give an example of Stored Procedure?  2
can you any body tell me simple recovery,full recovery,bulk logged recovery where can use?  1
What is indexed views? plz explain with example?  1
Define candidate key, alternate key, composite key.  9
Can you link only other SQL Servers or any database servers such as Oracle?  1
What is the difference between the following two sql statements select count(*) from <tablename> select count(col_name) from <tablename> 247Customer2
how to rest identity columns in sql server Matrix3
Accidentally i deleted my table. How can i get that table?  4
write down the code for "how we delete a table without using of Drop command " ? Sonata1
how to get the automatic backup of the database in the sql server  3
What are the advantages of using views. Why do we need views when we have SPs? 247Customer3
Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table? eFunds5
difference between sql server2000 and sql server2005 KPMG1
I need a query that retrieves info from an Oracle table and a query that retrieves info from a SQL Server table. The info has to be joined together according to Record ID numbers. I have very limited access to the Oracle database but full control of the SQL Server database.How do I join two different queries from two different databases?  1
what purpose does OPENXML clause have in sql server stored procedure?  1
What is a sub-query? When would you use one?  3
How many index keys possible for a table  6
What are different types of Keys? Please explain all the keys with a suitable example.  1
in tabase table having a column in it empname field is there which having 5 duplicate values is there i want deleted all the duplicates i want showing only one name only.  7
 
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