Table: olympic_gymnastics_medals
Columns: rank
nation
gold
silver
bronze
total

Question: How many gold medals for Bulgaria (BUL) with 2 silvers and a less than 18 rank?
SQL: SELECT SUM("gold") FROM olympic_gymnastics_medals WHERE "silver" = 2 AND "nation" = 'bulgaria (bul)' AND "rank" < 18

Question: What's the most bronze medals for Great Britain (GBR) with more than 1 silver and ranked more than 6?
SQL: SELECT MAX("bronze") FROM olympic_gymnastics_medals WHERE "rank" > 6 AND "nation" = 'great britain (gbr)' AND "silver" > 1

Question: What's the total silver medals having less than 2 gold and 2 bronze?
SQL: SELECT COUNT("silver") FROM olympic_gymnastics_medals WHERE "bronze" = 2 AND "gold" < 2