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

Question: What is the average silver for a rank less than 8, were there were no more than 4 bronze and 12 in total?
SQL: SELECT AVG("silver") FROM "sporting_events" WHERE "rank"<8 AND "total"=12 AND "bronze"<4;

Question: How many gold did Gabon have when they were ranked no higher than 17, and less than 7 in total?
SQL: SELECT SUM("gold") FROM "sporting_events" WHERE "total"<7 AND "nation"='gabon' AND "rank"<17;