FIT1004 Lecture Notes - Lecture 7: Virtual Method Table
Lecture 7: Correlated subquery
● related to the outer query (references the outer columns in the outer query)
● executed repeatedly, one for each row fetched by the outer query
● example : List all the employees (empno, empname, empinit, empbdate & deptno) who
are oldest in the department they work in
EXISTS PREDICATE
● Evaluates to "true" if the set represented by the subquery is not empty, otherwise “false”
●Example: List all the employees if and only if one or more of the employees have
monthly salary less than 6000
● List all the departments that do not have any employee