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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / rashmi

> we use IN gives better performance when there is less number of record in a table (up to 999 records), But for large number records EXIST give better performance.
>In may or may not depends a sub query all time, But EXIST always depend on a sub query.

Is This Answer Correct ?    2 Yes 1 No

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

Answer / manoranjan sethy

Exist operator always faster then In operator.
because assume that we gave value like in(10) then what is does? it will search my entire table and wherever 10 is found it will return as output.
but in exist operator if 10 found then optimizer will stop the searching process that is how exist gives more performance.

ii) In operator all ways conduct pattern search process but exist conduction boolean state of search process.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

what is check constraint? : Sql dba

1 Answers  


What is sql mysql pl sql oracle?

0 Answers  


I have a package in which a table was used in a procedure and compiled later i have dropped the table used in the package what would be the status of package specification and body

1 Answers   TCS,


how mysql optimizes distinct? : Sql dba

0 Answers  


What is pl sql record in oracle?

0 Answers  






What is clustered and nonclustered index in sql?

0 Answers  


What is sqlerrm?

0 Answers  


What is pl sql architecture?

0 Answers  


What is a sql trace file?

0 Answers  


explain the difference between bool, tinyint and bit. : Sql dba

0 Answers  


trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output trans_id trans_date trans_amt debit_credit_indicator 001 JAN 1599 cr no.of trans 2 i want trans_id and trans_date like 'JAN' or 'FEB' etc, trans_amt i want all credit amount - debit amount per each trans_id. and debit_credit_indicator and no.of transactions in a month.

1 Answers   Oracle,


What is the largest value that can be stored in a byte data field?

0 Answers  


Categories