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 are all the common sql function? : Sql dba
How to convert comma separated string to array in pl/sql?
What are the parameter modes supported by pl/sql?
How to pronounce postgresql?
What does fetching a cursor do?
What is the primary key?
What are the different ddl commands in sql?
What are the different datatypes available in PL/SQL?
What is break?
what are the advantages a stored procedure? : Sql dba
What are its different types of dbms?
How many scalar data types are supported in pl/sql?
What is compiled query?
What are the types of functions in sql?
What are local and global Indexes and where they are useful.