CSE 132A Lecture 4: L4 10/10/18
Document Summary
If a condition in the where clause of a nested query references an attribute of a relation declared in the outer query, the two queries are said to be correlated. Result of a correlated nested query may be different for each tuple. Find all movies in which hitchcock does not act: Find the names of employees w/ the max salary - non-monotonic! Ex: find actors playing in every movie by berto . In sql: find the actors for which there is no movie by bertolucci in which they do not act. Or: find the actors not among the actors for which there is some movie by bertolucci in which they do not act. Exists (select a from r where a < 4) Not exists (select a from r where a > 10) Exists (select * from r where a< b)