adspace


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 common sql function? : Sql dba

1131


how to escape special characters in sql statements? : Sql dba

1114


Can delete statement be rollbacked?

1054


how to start mysql server? : Sql dba

1267


what is bcp? When does it used? : Sql dba

1056


Does group by remove duplicates?

1112


What is the current version of postgresql?

1178


Is primary key clustered index?

1019


What is the best sql course?

1050


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2091


What is your daily office routine?

2346


Is primary key always clustered index?

1095


what are the advantages of sql ? : Sql dba

1142


what is dbms? : Sql dba

1061


how many tables will create when we create table, what are they? : Sql dba

1144