WHAT IS THE LOWEST AVERAGE FINISH FOR 40TH POSITION, WITH A TOP 5 LARGER THAN 0?
CREATE TABLE table_name_70 (avg_finish INTEGER, position VARCHAR, top_5 VARCHAR)
SELECT MIN(avg_finish) FROM table_name_70 WHERE position = "40th" AND top_5 > 0
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE table_name_70 (avg_finish INTEGER, position VARCHAR, top_5 VARCHAR) Question: WHAT IS THE LOWEST AVERAGE FINISH FOR 40TH POSITION, WITH A TOP 5 LARGER THAN 0? [/INST] SELECT MIN(avg_finish) FROM table_name_70 WHERE position = "40th" AND top_5 > 0 </s>