Context: CREATE TABLE table_name_40 (goals_for VARCHAR, played VARCHAR, draws VARCHAR, losses VARCHAR)
Question: What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38?
Answer: SELECT COUNT(goals_for) FROM table_name_40 WHERE draws = 3 AND losses > 18 AND played < 38