CREATE TABLE person (name CLOB, age NUMBER, city CLOB, gender CLOB, job CLOB)
CREATE TABLE personfriend (name CLOB, friend CLOB, year NUMBER)

Which person whose friends have the oldest average age?
SELECT T2.name, AVG(T1.age) FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1
SELECT "T2"."name", AVG("T1"."age") FROM "person" "T1" JOIN "personfriend" "T2" ON "T1"."name" = "T2"."friend" GROUP BY "T2"."name" ORDER BY AVG("T1"."age") DESC FETCH FIRST 1 ROWS ONLY