Table: election_results_2011
Columns: rank
constituency
winning_party_2007
swing_to_gain
ld_s_place_2007
result

Question: what is the constituency when the swing to gain is less than 4.16, the winning party 2007 is snp and ld's place 2007 is 2nd?
SQL: SELECT "constituency" FROM election_results_2011 WHERE "swing_to_gain" < 4.16 AND "winning_party_2007" = 'snp' AND "ld_s_place_2007" = '2nd'

Question: how many times is the constituency edinburgh northern and leith?
SQL: SELECT COUNT("swing_to_gain") FROM election_results_2011 WHERE "constituency" = 'edinburgh northern and leith'

Question: what is the constituency when the rank is less than 5 and the result is con hold?
SQL: SELECT "constituency" FROM election_results_2011 WHERE "rank" < 5 AND "result" = 'con hold'

Question: what is the lowest rank when the constituency is edinburgh northern and leith and the swing to gain is less than 4.16?
SQL: SELECT MIN("rank") FROM election_results_2011 WHERE "constituency" = 'edinburgh northern and leith' AND "swing_to_gain" < 4.16