CREATE TABLE "by_season" (
  "season" real,
  "champion" text,
  "motorcycle" text,
  "wins" real,
  "2nd_pl" real,
  "3rd_pl" real,
  "team" text
);

Question: what is the average season when results is less than 2 times in 2nd and more than 6 times in 3rd?
SQL: SELECT AVG("season") FROM "by_season" WHERE "2nd_pl"<2 AND "3rd_pl">6;

Question: How many times was the motorcycle ducati 916 2nd place when wins is less than 7?
SQL: SELECT SUM("2nd_pl") FROM "by_season" WHERE "motorcycle"='ducati 916' AND "wins"<7;

Question: Who is the champion when the motorcycle is ducati 916 and 2nd place is less than 5?
SQL: SELECT "champion" FROM "by_season" WHERE "motorcycle"='ducati 916' AND "2nd_pl"<5;