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

Question: What is the number in total of silver with a gold smaller than 0?
SQL: SELECT COUNT("silver") FROM "medal_table" WHERE "gold"<0;

Question: What is the sum of gold with a rank that is 3 and a silver larger than 7?
SQL: SELECT SUM("gold") FROM "medal_table" WHERE "rank"='3' AND "silver">7;

Question: What is the average total with a nation of thailand with a gold smaller than 17?
SQL: SELECT AVG("total") FROM "medal_table" WHERE "nation"='thailand' AND "gold"<17;

Question: What is the average gold with a bronze smaller than 5 with a rank of 8?
SQL: SELECT AVG("gold") FROM "medal_table" WHERE "bronze"<5 AND "rank"='8';