CREATE TABLE "references" (
  "year" real,
  "miss_earth" text,
  "miss_air_1st_runner_up" text,
  "miss_water_2nd_runner_up" text,
  "miss_fire_3rd_runner_up" text
);

Question: What year was Caroline Medina Miss Fire (3rd Runner-up)?
SQL: SELECT AVG("year") FROM "references" WHERE "miss_fire_3rd_runner_up"='caroline medina';

Question: Who won Miss Air (1st Runner-up) when Catherine Untalan was Miss Water (2nd Runner-up) earlier than 2007?
SQL: SELECT "miss_air_1st_runner_up" FROM "references" WHERE "year"<2007 AND "miss_water_2nd_runner_up"='catherine untalan';