CREATE TABLE "achievements" (
  "year" real,
  "competition" text,
  "venue" text,
  "position" text,
  "event" text
);

Question: When is the earliest year for it is in barcelona, spain?
SQL: SELECT MIN("year") FROM "achievements" WHERE "venue"='barcelona, spain';

Question: What is the average year they finished 5th in santiago, chile?
SQL: SELECT AVG("year") FROM "achievements" WHERE "position"='5th' AND "venue"='santiago, chile';