what is the difference between the query and corelated
query

Answers were Sorted based on User's Feedback



what is the difference between the query and corelated query..

Answer / guru

Correlated Query: If a sub query has a Reference with the
value or values of Main Query , It is called as Correlated
Sub query.

Thanks

Is This Answer Correct ?    11 Yes 2 No

what is the difference between the query and corelated query..

Answer / saurabh

When 1st main query is executed then the result of the main
query is used in teh where clause of subquery then this
type of subquery is called as co-related sub query.

Is This Answer Correct ?    7 Yes 0 No

what is the difference between the query and corelated query..

Answer / aravinda

query: query is single time validation of conditions for
entire result once result is fetched there no further
validation of records.

corelated sub query : each record is validated with inner
query aftr fetch.

1) outer query will execute first and pass a value to inner
query.
2) based on outer query value inner query will execute.
3) based on inner query value the outer query record will be
validated.

inner query will execute for every record of outer query( if
outer query has 10 records inner query will execute 10 times)

Is This Answer Correct ?    6 Yes 0 No

what is the difference between the query and corelated query..

Answer / manish

select * from emp; --->> query

select * from emp where sal=(select max(sal) from emp);
--> here a sub query is also there

select * from emp outer where sal= ( select avg(sal) from
emp e where dept.e=dept.outer) --> corelated query

Is This Answer Correct ?    9 Yes 7 No

what is the difference between the query and corelated query..

Answer / chintu

A query is nothing but if we want to evaluate one thing we
will write query. like
select * from emp; --->> query

A Query is evaluated once for each and every row from the
parent statement is called corellated Query.
like
select * from emp outer where sal= ( select avg(sal) from
emp e where dept.e=dept.outer) --> corelated query

Is This Answer Correct ?    2 Yes 0 No

what is the difference between the query and corelated query..

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

what is the difference between the query and corelated query..

Answer / amar_kondla

select * from emp----- is a query;


and

co-related query is sub one of sub qury( sub qury
means--whose returning values are filtering the condition
of the main query)
ex; SELECT * FROM EMP E
WHERE E.SAL>( SELECT AVG(SAL) FROM EMP F
WHERE E.DEPTNO= F.DEPTNO);


SO HERE WE R FINDING THE EMPLOYEE WHO HAS GETTING MORE THAN
AVG(SAL) OF RESPECTING DEPTNO.

AND CO RELATED SUB QUERY ALWAYS USE ALIAS NAME FOR TABLE, IT
SIMILAR LIKE JAIN(SELF JOIN)

Is This Answer Correct ?    3 Yes 4 No

what is the difference between the query and corelated query..

Answer / guruswamy

corelated query is refered by each an every value by
subquery.
normal query is referd by subquery one bulk amount to get a
main query

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

Explain isolation levels. : Transact sql

0 Answers  


What are the modes of parameters that can be passed to a procedure ?

3 Answers  


What are sql constraints?

0 Answers  


what is the difference between union and union all? : Sql dba

0 Answers  


Why do we use procedures?

0 Answers  






What if we write return in procedure?

0 Answers  


What is the process of debugging?

0 Answers  


What is restrict in sql?

0 Answers  


What is data profiling in sql?

0 Answers  


Name some usages of database trigger?

0 Answers  


Is postgresql a nosql database?

0 Answers  


Explain ddl statements in pl/sql?

0 Answers  


Categories