How much Goal Difference has less than 9 Losses, and 8 Draws, and more than 40 points?
CREATE TABLE table_name_22 (goal_difference INTEGER, points VARCHAR, losses VARCHAR, draws VARCHAR)
SELECT SUM(goal_difference) FROM table_name_22 WHERE losses < 9 AND draws = 8 AND points > 40
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE table_name_22 (goal_difference INTEGER, points VARCHAR, losses VARCHAR, draws VARCHAR) Question: How much Goal Difference has less than 9 Losses, and 8 Draws, and more than 40 points? [/INST] SELECT SUM(goal_difference) FROM table_name_22 WHERE losses < 9 AND draws = 8 AND points > 40 </s>