CREATE TABLE "motorcycle_grand_prix_results" (
  "year" real,
  "class" text,
  "team" text,
  "points" real,
  "rank" text,
  "wins" real
);

Question: Which class had a rank of 2nd?
SQL: SELECT "class" FROM "motorcycle_grand_prix_results" WHERE "rank"='2nd';

Question: How many wins did the 500cc class have in 1979?
SQL: SELECT "wins" FROM "motorcycle_grand_prix_results" WHERE "class"='500cc' AND "year"=1979;

Question: What is the total of the points for wins under 6 and a rank of 2nd?
SQL: SELECT SUM("points") FROM "motorcycle_grand_prix_results" WHERE "rank"='2nd' AND "wins"<6;

Question: Which class had 110 points?
SQL: SELECT "class" FROM "motorcycle_grand_prix_results" WHERE "points"=110;

Question: What is the average year having 142 points?
SQL: SELECT AVG("year") FROM "motorcycle_grand_prix_results" WHERE "points"=142;