What is the diffrence between IN and EXISTS.which one is
faster.

Answer Posted / neha

In the in clause, the inner query is executed first, hence if the inner query return less data than the outer query, then use IN clause, in the other scenario, user exists clause.

Also, in the exists clause the inner query always reference outer query's table, which may or may not be the case with in IN clause.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a relationship and what are they?

780


Can we rollback after truncate?

752


Explain foreign key in sql?

786


What is the maximum size of sqlite database?

726


What is a join?

809






What are aggregate functions in sql?

839


Why trigger is used in sql?

690


Which is faster count (*) or count 1?

757


How do you identify a primary key?

811


What is normalization? How many normalization forms are there?

747


Which one is better subquery or joins?

775


How to revise and re-run the last sql command?

835


What is meaning of <> in sql?

796


what is the difference between nested subquery and correlated subquery?

744


What is a null value?

845