CREATE TABLE "table1_2221374_3" (
  "no_in_series" real,
  "no_in_season" real,
  "title" text,
  "directed_by" text,
  "written_by" text,
  "original_air_date" text,
  "production_code" real
);

Question: Who directed "Freaky Friday"?
SQL: SELECT "directed_by" FROM "table1_2221374_3" WHERE "title"='\"Freaky Friday\"';

Question: What date was the episode originally aired that was directed by James Widdoes and the production code is 320?
SQL: SELECT "original_air_date" FROM "table1_2221374_3" WHERE "directed_by"='James Widdoes' AND "production_code"=320;

Question: How many production codes are there for "the sub"?
SQL: SELECT COUNT("production_code") FROM "table1_2221374_3" WHERE "title"='\"The Sub\"';

Question: What is the production code for episode 3 of the season?
SQL: SELECT "production_code" FROM "table1_2221374_3" WHERE "no_in_season"=3;