Table: francophonie_medals
Columns: rank
nation
gold
silver
bronze
total

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 francophonie_medals 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 francophonie_medals WHERE "total" < 7 AND "nation" = 'gabon' AND "rank" < 17