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
What is sequence in sql?
In pl/sql, what is bulk binding, and when/how would it help performance?
What is a temp table?
tell us something about heap tables. : Sql dba
What are stored procedures used for?
What is inner join in sql?
Is it possible to sort a column using a column alias?
What is the difference between join and natural join?
What are reports usually used for?
What is set transaction?
What is %type in sql?
How does sql developer connect to oracle database?
Can we debug stored procedure?
How many functions are there in sql?
How to call a javascript function from pl sql?