CREATE TABLE "episodes" (
  "episode_num" real,
  "title" text,
  "air_date" text,
  "rating" real,
  "share" real,
  "18_49" real,
  "viewers" real,
  "rank" text
);

Question: What is the total number of Viewers when the rank is #40?
SQL: SELECT COUNT("viewers") FROM "episodes" WHERE "rank"='#40';

Question: What is the average Episode # with a share of 9, and #35 is rank and less than 8.21 viewers?
SQL: SELECT AVG("episode_num") FROM "episodes" WHERE "share"=9 AND "rank"='#35' AND "viewers"<8.21;

Question: What is the average Episode # with a 7 share and 18–49 is less than 2 and the Air Date of may 21, 2009?
SQL: SELECT AVG("episode_num") FROM "episodes" WHERE "share"=7 AND "18_49"<2 AND "air_date"='may 21, 2009';

Question: What is the lowest Viewers that has an Episode #higher than 58 with a title of "curveball" less than 4.1 rating?
SQL: SELECT MIN("viewers") FROM "episodes" WHERE "episode_num">58 AND "title"='\"curveball\"' AND "rating"<4.1;

Question: What is the Air Date that has a 18–49 larger than 1.9, less than 7.54 viewers and a rating less than 4.9?
SQL: SELECT "air_date" FROM "episodes" WHERE "18_49">1.9 AND "viewers"<7.54 AND "rating"<4.9;