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
How do I copy a table in sql?
What is meant by user defined function?
What is a table?
Why truncate is faster than delete?
How many unique keys can a table have?
State few characteristics of pl/sql?
What is the least restrictive isolation level? : Transact sql
Why stored procedure is better than query?
What is record variable?
define sql delete statement ? : Sql dba
Can we connect to postgresql using sql developer?
What is materialized view in sql?
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?
How to avoid duplicate records in a query?
What is difference between hql and native sql?