This is an example of Double Nested NOT EXISTS
query. That is, it has a NOT EXISTS
clause within a
NOT EXISTS
clause. Formally, it answers the question “does an employee exist with projectname Database and a project that is not in Works
”? But it is easier to say that a nested NOT EXISTS
answers the question
“is x
TRUE
for all y
?”
In our case, that is equivalent to "Find the employees whos age is more than 30 and works for every project with project name database"