CREATE TABLE "2008_summer_olympics_medal_table" (
  "rank" text,
  "gold" real,
  "silver" real,
  "bronze" real,
  "total" real
);

Question: What is the total number of gold medals when there were 2 bronze medals, a total of more than 3 medals and ranked 61?
SQL: SELECT COUNT("gold") FROM "2008_summer_olympics_medal_table" WHERE "bronze"=2 AND "rank"='61' AND "total">3;

Question: What is the average total number of medals when there were 4 bronze, more than 2 silver, and less than 7 gold medals?
SQL: SELECT AVG("total") FROM "2008_summer_olympics_medal_table" WHERE "bronze"=4 AND "silver">2 AND "gold"<7;