Database Management System - Chapter 9: Advanced Query Formulation with SQL- Part 2
Before beginning the animation, let's examine a SELECT statement containing a Type II nested query. Execution model of the Type II Nested query: - More complex execution model: nested loops - Nested query executes one time for each row in the outer query Example query: - Retrieve faculty who are not students - Type II nested query implementation of a difference problem - Set of all faculty MINUS Set of Faculty who are students - Result: set of faculty who are not students EXISTS comparison: - True if nested query is not empty (one or more rows); false otherwise - NOT EXISTS: true if nested query is empty