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

Find the name, age, and job title of persons who are friends with Alice for the longest years.
SELECT T1.name, T1.age, T1.job FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(year) FROM personfriend WHERE friend = 'Alice')
SELECT "T1"."name", "T1"."age", "T1"."job" FROM "person" "T1" JOIN "personfriend" "T2" ON "T1"."name" = "T2"."name" AND "T2"."friend" = 'Alice' AND "T2"."year" = (SELECT MAX("year") FROM "personfriend" WHERE "friend" = 'Alice')