CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)
CREATE TABLE person (age INT)
CREATE TABLE Person (name VARCHAR, age INT)

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" AS "T1" JOIN "PersonFriend" AS "T2" ON "T1"."name" = "T2"."friend" WHERE "T1"."age" < (SELECT AVG("age") FROM "person")