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 ?    7 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 ?    13 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 ?    4 Yes 0 No
Navneet Sharma
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What are cursors?  8
What is excution Plan in sql server TCS1
WHAT OPERATOR PERFORMS PATTERN MATCHING? CTS2
what is for foreign key ?? Sabic3
HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE TCS16
how will u create "n" possible tables in sql... Oracle1
what is difference between having and where clause ?  2
How do we rollback the table data in SQL Server  3
What is the use of CASCADE CONSTRAINTS?  2
What are statistics, under what circumstances they go out of date, how do you update them? HCL2
CLR Integration ? what is Notification services ? Satyam1
What is difference between Triggers and store procedure?  2
What are Sql Reporting Services and analysis services? Can u Explain  1
How to list all tables having unique constraints in any of the columns in a database.  1
Is it possible to create tables in stored procedures using a variable for the table name?  2
Explain the new features of SQL server 2000?  1
I am Having tables T1 and T2 both having same data how to check (or) compare the data in both table are same?  2
what is replication? where do u use Go Keyword? Satyam1
What is a trigger?  6
could u plz explain about joins and views?  2
 
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