What is the average number of gold medals won by Brazil for entries with more than 1 bronze medal but a total smaller than 4?
CREATE TABLE "medal_table" (
  "rank" text,
  "nation" text,
  "gold" real,
  "silver" real,
  "bronze" real,
  "total" real
);
SELECT AVG("gold") FROM "medal_table" WHERE "total"<4 AND "nation"='brazil' AND "bronze">1;