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

Whare the names, friends, and ages of all people who are older than the average age of a person?
SELECT DISTINCT T2.name, T2.friend, T1.age 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", "T2"."friend", "T1"."age" FROM "person" "T1" JOIN "personfriend" "T2" ON "T1"."name" = "T2"."friend" WHERE "T1"."age" > (SELECT AVG("age") FROM "person")