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 ? | 15 Yes | 3 No |
Post New Answer View All Answers
What is difference between function and trigger?
When is a declare statement required?
How do I delete a trigger?
What does where 1 1 mean in sql?
How many functions are there in sql?
What are the types of queries in sql?
Can sql developer connect to db2?
what is the command line end user interface - mysql? : Sql dba
What is difference between db2 and sql?
What is percent sign in sql?
What is an intersect?
what is uncommittable transactions? : Transact sql
How sql query is executed?
What is vector point function?
How do you modify a trigger?