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

Who has friends that are younger than the average age?
SELECT DISTINCT T2.name FROM person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person)
SELECT DISTINCT "T2"."name" FROM "person" "T1" JOIN "PersonFriend" "T2" ON "T1"."name" = "T2"."friend" WHERE "T1"."age" < (SELECT AVG("age") FROM "person")