How many losses when goals against are more than 17, goal difference is more than 2 and points are more than 5?
CREATE TABLE "promotion_playoff" (
  "position" real,
  "club" text,
  "played" real,
  "points" real,
  "wins" real,
  "draws" real,
  "losses" real,
  "goals_for" real,
  "goals_against" real,
  "goal_difference" real
);
SELECT AVG("losses") FROM "promotion_playoff" WHERE "goals_against">17 AND "goal_difference"<2 AND "points">5;