CREATE TABLE Person (name VARCHAR2, age NUMBER)
CREATE TABLE PersonFriend (name VARCHAR2, friend VARCHAR2)

Find the name of the person who has friends with age above 40 but not under age 30?
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)
SELECT "T1"."name" FROM "Person" "T1" JOIN "PersonFriend" "T2" ON "T1"."name" = "T2"."name" AND "T2"."friend" IN (SELECT "name" FROM "Person" WHERE "age" > 40) EXCEPT SELECT "T1"."name" FROM "Person" "T1" JOIN "PersonFriend" "T2" ON "T1"."name" = "T2"."name" AND "T2"."friend" IN (SELECT "name" FROM "Person" WHERE "age" < 30)