What is the exact difference b/w IN and EXIST in Oracle..?

Answers were Sorted based on User's Feedback



What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / venkateshmalneni

EXIST is used as conditional operator in which u can write a query
IN is also used as a conditional operator in which we gives a list of elements

Is This Answer Correct ?    4 Yes 1 No

What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / moorthy g

select ename from emp e
where mgr in (select empno from emp whereename = 'KING');

Here's the EXPLAIN PLAN for this query:

OBJECT OPERATION
---------- ----------------------------------------
SELECTSTATEMENT()
NESTEDLOOPS()
EMP TABLEACCESS(FULL)
EMP TABLEACCESS(BY INDEX ROWID)
PK_EMP INDEX(UNIQUESCAN)

This query is virtually equivalent to this:

select e1.ename from emp e1,(select empno from empwhere
ename = 'KING') e2
where e1.mgr = e2.empno;

You can write the same query using EXISTS bymoving the outer
query column to a subquery condition, likethis:

select ename from emp e
where exists (select 0 from emp wheree.mgr = empno and
ename = 'KING');

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

Is This Answer Correct ?    2 Yes 0 No

What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / sujeetha

It is almost similar to IN but the difference is that in
EXIST it will retrive the row atleast one row in the inner
query satisfies but in IN we can have manuy values

Is This Answer Correct ?    1 Yes 0 No

What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / pavan_615

IN- sub Query - it will be executed once for the full query
Exist - Co-related sub Query - it will be executed for each
row.-- exist will me faster when you are working with big
tables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Informatica Interview Questions

Target is zero file and how can you send the email?

2 Answers   Bank Of America,


What are the Advantages of de normalized data?

3 Answers  


How to list Top 10 salary, without using Rank Transmission?

16 Answers   Infosys,


I am getting five sources in a day and i donot know when i get them. i need to load data into the target and run the session. but here i can't keep the session in running or can't stop the session. plz help me

6 Answers   Mastek,


Explain incremental aggregation in informatica

0 Answers   Informatica,






scenario where i can use only concurrent execution of workflow.

0 Answers   Cognizant,


In which circumstances that informatica server creates Reject files?

2 Answers  


i have n number of records in my source, i want first and last record to my target. how can u implement this scenario .

6 Answers   Emphasis,


What are the connected or unconnected transforamations?

2 Answers  


I still need further explanation about the difference between active and passive transformation with some examples.Thank You

5 Answers  


Which transformation is needed while using the Cobol sources as source definitions?

0 Answers   Informatica,


As union transformation gives UNION ALL output, how you will get the UNION output?

0 Answers   Informatica,


Categories