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 correlated sub-query?

Answer Posted / asnani_satish@yahoo.com

Minor correction in above answer
Difference between sub-query, correlated query and query as
table
1. Sub-query : the inner query is executed in entirety
before the outer query is executed
eg select * from emp where deptno in (select deptno from dept);

2. Correlated Query: For each record fetched in outer query
corresponding matching records are fetched in sub-query
because of join condition within inner sub-query. Answers
1,2,3 are correct

3. Query as Table: A query can behave as a table

select a.empno,a.sal,a.sal/b.avgsal*100 as percent_avg_sal
from emp a,(select deptno,avg(sal) avgsal from emp group by
deptno) b
where a.deptno=b.deptno;

Here the entire "(select deptno,avg(sal).....)" behaves as
table named "b" containing dept wise average sal. The query
is behaving as a temporary table.

Is This Answer Correct ?    6 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are properties of the transaction?

957


What is difference between table and view?

978


What is sqlca in db2?

894


If a cursor is open, how can we find in a pl/sql block?

1105


What are two statement types in sql?

1033


What is the use of sql trace?

897


What kind of join is join?

905


How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

1037


What is sql key?

923


Name some usages of database trigger?

969


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

988


What are the three forms of normalization?

996


What is sql deadlock?

1050


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

909


How to Execute a Package in PL/SQL.?

1110