How many gold medals for a nation with rank less than 5, more than 0 silvers and a total of 2 medals?
CREATE TABLE table_name_27 (gold INTEGER, total VARCHAR, rank VARCHAR, silver VARCHAR)
SELECT AVG(gold) FROM table_name_27 WHERE rank < 5 AND silver > 0 AND total = 2
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE table_name_27 (gold INTEGER, total VARCHAR, rank VARCHAR, silver VARCHAR) Question: How many gold medals for a nation with rank less than 5, more than 0 silvers and a total of 2 medals? [/INST] SELECT AVG(gold) FROM table_name_27 WHERE rank < 5 AND silver > 0 AND total = 2 </s>