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

What is the difference between join and natural join?

1 Answers  


How do I count duplicates in sql?

1 Answers  


hi this is nakka i have been looking for 1+ exp in oracle sql,plsql developer positions also have knoledge on d2k i am not getting proper walkins how to know it? where can i find it?

5 Answers  


What is the most important ddl statements in sql are?

1 Answers  


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

1 Answers  


How many commands are there in sql?

1 Answers  


what is the difference between char and varchar data types? : Sql dba

1 Answers  


Question: Below is the table city gender name delhi male a delhi female b mumbai male c mumbai female d delhi male e I want the o/p as follows: male female delhi 2 1 mumbai 1 1 Please help me in writing the query that can yield the o/p mentioned above?

2 Answers  


How do I remove duplicates in two columns?

0 Answers  


When to use inner join and left join?

1 Answers  


When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?

1 Answers  


What is right join sql?

1 Answers  


Categories