Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

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

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

Answer / shafi

Correlated Sub Query:
It is a sub-query (a query nested inside another query)
that uses values from the outer query in its WHERE clause.
The sub-query is evaluated once for each row processed by
the outer query

Inner query:
It is a query that is nested inside a SELECT, INSERT,
UPDATE, or DELETE statement or inside another subquery. A
subquery can return a set of rows or just one row to its
parent query. A scalar subquery is a query that returns
exactly one value: a single row, with a single column.

Is This Answer Correct ?    11 Yes 2 No

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

Answer / yuvaevergreen

As said above, the main difference between a correlated Sub
Query and an inner query is that in a correlated sub query,
the inner query refers back to the column(s) in the outer
query i.e., the inner query is executed for each row of the
outer query.In the below query, the avg(salary) query is
executed for each row in the outer query.
-->>
sel * from employee as e where salary > (sel avg(salary) from
employee as b where e.deptno=b.deptno);

Is This Answer Correct ?    4 Yes 0 No

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

Answer / girish

I think the process of sub query is other way arround

The inner query give each value got from the SELECT to the
outer query for processing...
So ..
The outer queryis evaluated once for each row processed by
the sub-query.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Teradata Interview Questions

During the Display time, how is the sequence generated by Teradata?

0 Answers  


How many tables can you join in v2r5?

0 Answers  


What tools would you use for that?

0 Answers  


what is DYNAMIC SQL in TD?

1 Answers   IBM,


Which is more efficient group by or distinct to find duplicates?

0 Answers  


What do you mean by caching in teradata?

0 Answers  


Can we collect statistics on multiple columns?

0 Answers  


Hi Friends I have a sql question, We have the source data as below. 101 address1, address2, address3 and the output shoulb like below 101 address1 101 address2 101 address3 Required a SQL query for this output. Please let me know if you have any sql query for this. Thanks in advance. Hari M

6 Answers   JPMorgan Chase,


Why MLOAD needs Work Tables?

5 Answers   Teradata,


What are the multiload utility limitations?

0 Answers  


How to explain project Architecture and flow in teradata interviews?Can please anyone help on this? Am new to teradata.

0 Answers   Infosys, Wells Fargo,


A certain load is being imposed on the table and that too, every hour. The traffic in the morning is relatively low, and that of the night is very high. As per this situation, which is the most advisable utility and how is that utility supposed to be loaded?

0 Answers  


Categories