CREATE TABLE "medal_table" (
  "rank" text,
  "nation" text,
  "gold" real,
  "silver" real,
  "bronze" real,
  "total" real
);

Question: What is the sum of Gold, when Total is greater than 2, when Bronze is greater than 1, and when Silver is less than 1?
SQL: SELECT SUM("gold") FROM "medal_table" WHERE "total">2 AND "bronze">1 AND "silver"<1;

Question: What is the sum of Gold, when Total is less than 1?
SQL: SELECT SUM("gold") FROM "medal_table" WHERE "total"<1;

Question: What is the average Total, when Gold is 0, and when Nation is Iran?
SQL: SELECT AVG("total") FROM "medal_table" WHERE "gold"=0 AND "nation"='iran';

Question: What is the sum of Total, when Nation is West Germany, and when Gold is greater than 2?
SQL: SELECT SUM("total") FROM "medal_table" WHERE "nation"='west germany' AND "gold">2;

Question: What is the average Total, when Gold is less than 0?
SQL: SELECT AVG("total") FROM "medal_table" WHERE "gold"<0;