DBA > Job Interview Questions > DB2 ( IBM Database 2 ) Interview Questions

What is correlated subquery ?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

What is correlated subquery ?

A correlated subquery is one that has a correlated name as a table or view designator in the FROM clause of the outer query and the same correlation name as a qualifier of a search condition in the WHERE clause of the subquery. For example:

SELECT col_name1,col_name2
FROM table_A
WHERE col_name3 < ( SELECT Avg(col_name)
FROM table_A
WHERE col_name4 = x1.col_name4 )

(Continued on next question...)

Other Job Interview Questions