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

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,sum(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". The query is behaving as a temporary table.

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I copy a table in sql?

989


What is meant by user defined function?

1051


What is a table?

1016


Why truncate is faster than delete?

1114


How many unique keys can a table have?

1016


State few characteristics of pl/sql?

971


What is the least restrictive isolation level? : Transact sql

1069


Why stored procedure is better than query?

948


What is record variable?

993


define sql delete statement ? : Sql dba

1021


Can we connect to postgresql using sql developer?

1009


What is materialized view in sql?

921


How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?

1051


How to avoid duplicate records in a query?

1008


What is difference between hql and native sql?

1176