What is the difference between correlated sub queries and
inner queries?

Answer Posted / vinay sir(datawarehousing tech

Guys,
First of all the question is not proper,it is supposed to
be "the difference between correlated sub queries and
simpe sub queries".

Corelated and Simple, both are Subqueries(having inner and
outer queries) but the way they execute is different.
Simple Subquery:Inner query executed first and then outer
query. Inner query executed only one time.

Corelated Sub query:Outer query is executed first and then
inner query.Outer query is executed many times.

Please find a common example where you can see the
execution difference.

Simple Subquery: select max(sal) from emp where sal not in
(select max(sal) from emp)
Corelated: Select a.sal from emp e where 1=(select count
(distinct(b.sal)) from emp b where a.sal<b.sal)

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to run a query in teradata?

675


what is sysdba and sysdbc ? which has high priority ?

3441


What is difference between user and database in teradata?

722


How can bottlenecks be identified?

672


What are the 5 phases in a multiload utility?

704






What are the primary characteristics of the Teradata.

678


Define views in teradata with syntax.

724


How will you solve the problem that occurs during update?

692


What are differences between teradata and ansi session modes in teradata?

726


Hi Friends, Please send me Teradata Materials for certifications Thanks in advance !!

1786


What happens in a conflict? How do you handle that?

717


Explain PDE.

713


Explain the term 'row' related to relational database management system?

619


What are the steps to create a data model?

696


Explain how spool space is used.

702