CREATE TABLE "2009_ladder_and_finals" (
  "benalla_dfl" text,
  "wins" real,
  "losses" real,
  "draws" real,
  "byes" real,
  "against" real
);

Question: What's the total losses that has more than 12 wins and 1017 against?
SQL: SELECT COUNT("losses") FROM "2009_ladder_and_finals" WHERE "against"=1017 AND "wins">12;

Question: What's the most wins of Tatong?
SQL: SELECT MAX("wins") FROM "2009_ladder_and_finals" WHERE "benalla_dfl"='tatong';

Question: What's the most number of byes for Longwood having less than 1944 against?
SQL: SELECT MAX("byes") FROM "2009_ladder_and_finals" WHERE "benalla_dfl"='longwood' AND "against"<1944;

Question: What is the smallest number against when the draws are less than 0?
SQL: SELECT MIN("against") FROM "2009_ladder_and_finals" WHERE "draws"<0;

Question: What are the average byes of Bonnie Doon having more than 16 wins?
SQL: SELECT AVG("byes") FROM "2009_ladder_and_finals" WHERE "benalla_dfl"='bonnie doon' AND "wins">16;