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

Question: What was the highest number of bronze medals for the entry with rank 2 and fewer than 3 silver medals?
SQL: SELECT MAX("bronze") FROM "medal_table" WHERE "rank"='2' AND "silver"<3;

Question: 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?
SQL: SELECT AVG("gold") FROM "medal_table" WHERE "total"<4 AND "nation"='brazil' AND "bronze">1;

Question: What is the sum of silver medals for the entry with rank 3 and a total of 4 medals?
SQL: SELECT SUM("silver") FROM "medal_table" WHERE "total"=4 AND "rank"='3';