Table: segunda_division_stats_3
Columns: position
club
played
points
wins
draws
losses
goals_for
goals_against
goal_difference

Question: How many losses altogether were had by teams that won 12 times, had 40-4 points, and more than 57 goals?
SQL: SELECT SUM("losses") FROM segunda_division_stats_3 WHERE "wins" = 12 AND "points" = '40-4' AND "goals_for" > 57

Question: What's the average number of played games from Rayo Vallecano with less than 12 wins?
SQL: SELECT AVG("played") FROM segunda_division_stats_3 WHERE "club" = 'rayo vallecano' AND "wins" < 12