CREATE TABLE "charts" (
  "year" real,
  "single" text,
  "chart" text,
  "position" real,
  "weeks_on_chart" real
);

Question: What is the average weeks of a song with a larger than 3 position after 1977?
SQL: SELECT AVG("weeks_on_chart") FROM "charts" WHERE "position">3 AND "year">1977;

Question: What is the sum of the weeks on a chart a song with a position less than 1 haas?
SQL: SELECT SUM("weeks_on_chart") FROM "charts" WHERE "position"<1;

Question: What is the earliest year a song with a position less than 1 has?
SQL: SELECT MIN("year") FROM "charts" WHERE "position"<1;