Oracle correlated sub-queries

What is oracle correlated sub-queries? Explain with an example.

A query which uses values from the outer query is called as a correlated sub query. The subquery is executed once and uses the results for all the evaluations in the outer query.

Example:

Here, the sub query references the employee_id in outer query. The value of the employee_id changes by row of the outer query, so the database must rerun the subquery for each row comparison. The outer query knows nothing about the inner query except its results.
select employee_id, appraisal_id, appraisal_amount From employee
where
appraisal_amount < (select max(appraisal_amount)
from employee e
where employee_id = e. employee_id);
SQL-level tuning
Tuning disk and network I/O subsystem to optimize the I/O time, network packet size and dispatching frequency is called the server kernel optimization.....
What is a dynamic performance view in Oracle?
What is a dynamic performance view in Oracle?...
How to reference remote tables in procedures
Using SQL statements, remote tables can be accessed in procedures. Database links are specifically used for this purpose.......
Post your comment