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

Question: What team did carlos cardus drive for in 1983 when he got less than 21 points?
SQL: SELECT "team" FROM "motorcycle_grand_prix_results" WHERE "points"<21 AND "year"=1983;

Question: What is the sum of the points when Carlos drove for repsol honda in 8th place?
SQL: SELECT SUM("points") FROM "motorcycle_grand_prix_results" WHERE "team"='repsol honda' AND "rank"='8th';

Question: What is the average points won when Carlos had 0 wins?
SQL: SELECT AVG("points") FROM "motorcycle_grand_prix_results" WHERE "wins"<0;

Question: What is the highest year that Carlos drove for repsol honda and had less than 4 wins and less than 162 points?
SQL: SELECT MAX("year") FROM "motorcycle_grand_prix_results" WHERE "team"='repsol honda' AND "wins"<4 AND "points"<162;