Japan (JPN) with a total of less than 5, has what average gold medals?
CREATE TABLE "medal_table" (
  "rank" real,
  "nation" text,
  "gold" real,
  "silver" real,
  "bronze" real,
  "total" real
);
SELECT AVG("gold") FROM "medal_table" WHERE "nation"='japan (jpn)' AND "total"<5;