CREATE TABLE "red_dwarf_x" (
  "episode_no" real,
  "airdate" text,
  "dave_viewers" real,
  "dave_rank" real,
  "rank_cable" real,
  "dave_ja_vu_viewers" real,
  "total_viewers" real
);

Question: Which episode number aired on 18 october 2012?
SQL: SELECT MIN("episode_no") FROM "red_dwarf_x" WHERE "airdate"='18 October 2012';

Question: What is the lowest cable rank of an episode with 1464000 viewers?
SQL: SELECT MIN("rank_cable") FROM "red_dwarf_x" WHERE "total_viewers"=1464000;

Question: What is the highest number of dave viewers of an episode with 119000 dave ja vu viewers?
SQL: SELECT MAX("dave_viewers") FROM "red_dwarf_x" WHERE "dave_ja_vu_viewers"=119000;

Question: How many episodes aired on 25 october 2012?
SQL: SELECT COUNT("total_viewers") FROM "red_dwarf_x" WHERE "airdate"='25 October 2012';

Question: What was the airdate of the episode with 106000 dave ja vu viewers?
SQL: SELECT "airdate" FROM "red_dwarf_x" WHERE "dave_ja_vu_viewers"=106000;