CREATE TABLE table_23501 ("No. in series" TEXT, "No. in season" TEXT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" TEXT, "U.S. viewers  ( millions ) " TEXT)

Who wrote the episode with series number 45?
SELECT "Written by" FROM table_23501 WHERE "No. in series" = '45'
SELECT "Written by" FROM "table_23501" WHERE "No. in series" = '45'