CREATE TABLE table_25845 ("Series #" FLOAT, "Season #" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" TEXT)

What seasons in series 7 did David E. Kelley write ?
SELECT COUNT("Season #") FROM table_25845 WHERE "Written by" = 'David E. Kelley' AND "Series #" = '7'
SELECT COUNT("Season #") FROM "table_25845" WHERE "Series #" = '7' AND "Written by" = 'David E. Kelley'