Table: badminton_cwg_medals
Columns: rank
nation
gold
silver
bronze
total

Question: What is the most gold medals a team with less than 2 silvers, more than 7 total medals, and less than 8 bronze medals has?
SQL: SELECT MAX("gold") FROM badminton_cwg_medals WHERE "silver" < 2 AND "total" > 7 AND "bronze" < 8

Question: What is the number of bronze that Scotland, which has less than 7 total medals, has?
SQL: SELECT SUM("bronze") FROM badminton_cwg_medals WHERE "nation" = 'scotland' AND "total" < 7

Question: What is the average silver medals a team that has 1 gold and more than 5 bronze has?
SQL: SELECT AVG("silver") FROM badminton_cwg_medals WHERE "gold" = 1 AND "bronze" > 5

Question: What is the total number of bronze a team with more than 0 silver, a total of 7 medals, and less than 1 gold medal has?
SQL: SELECT COUNT("bronze") FROM badminton_cwg_medals WHERE "silver" > 0 AND "total" = 7 AND "gold" < 1

Question: What is the highest rank a team with 1 silver and less than 5 bronze medals has?
SQL: SELECT MAX("rank") FROM badminton_cwg_medals WHERE "silver" = 1 AND "bronze" < 5