CREATE TABLE "group_a2_promotion" (
  "position" real,
  "club" text,
  "played" real,
  "points" text,
  "wins" real,
  "draws" real,
  "losses" real,
  "goals_for" real,
  "goals_against" real,
  "goal_difference" real
);

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 "group_a2_promotion" 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 "group_a2_promotion" WHERE "club"='rayo vallecano' AND "wins"<12;