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 dynamic queries in t-sql? : Transact sql

557


what is table? : Sql dba

570


What is foreign key sql?

550


Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?

553


what are the types of join and explain each? : Sql dba

530






What is the use of <> sql?

549


Why do we use procedures in sql?

547


What are the advantages of pl sql over sql?

546


what is the difference between ereg_replace() and eregi_replace()? : Sql dba

552


What is native sql query?

546


What is set serveroutput on?

642


How do I run a sql query?

528


What is count * in sql?

551


How do you write an inner join query?

511


What is difference between stored procedures and application procedures?

567