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

Who are the friends of Alice that are doctors?
SELECT T2.friend FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'
SELECT "T2"."friend" FROM "person" "T1" JOIN "personfriend" "T2" ON "T1"."name" = "T2"."friend" AND "T2"."name" = 'Alice' WHERE "T1"."gender" = 'male' AND "T1"."job" = 'doctor'