what is the difference between the query and corelated
query

Answer Posted / lova raju allumalla

when performing joins on two or more tables, we normally
write a query making use relational operators such as =
etc. which means each and every row of every table is
compared with each other,which is a unwanted situation when
looked in the perspective performance issue. where as
making use of corelated query one can minimise the tedoius
checks as described above. consider the example below with
a normal join
select * from emp e,dept d where e.deptno=d.deptno;

now the above same can be performed by using the co related
query
select * from emp where deptno in (select deptno from dept);

u can now make up the difference, in the first approach in
emp table, each row deptno value compared for each row
deptno value of dept table.where as in second approach the
(select deptno from dept) is executed only once for all
checks of the outer query select * from emp where deptno

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are all the different normalization?

638


Where not exists in sql?

580


Explain foreign key in sql?

700


What is t sql used for?

629


What is crud sql?

627






What is dense_rank in sql?

629


How many columns should be in an index?

615


What is the use of sqldataadapter?

625


What is where clause in sql?

639


Explain the savepoint statement.

691


What is difference between function and trigger?

632


what happens if null values are involved in expressions? : Sql dba

657


Can we use threading in pl/sql?

610


What is full form of rtm?

617


Which constraints we can use while creating database in sql?

698