Table: tv_episode_data_31
Columns: series
season
title
directed_by
written_by
original_air_date
production_code

Question: When "the legacy" is the title what is the production code?
SQL: SELECT "production_code" FROM tv_episode_data_31 WHERE "title" = '"The Legacy"'

Question: When harvey laidman is the director what is the season number?
SQL: SELECT "season" FROM tv_episode_data_31 WHERE "directed_by" = 'Harvey Laidman'

Question: When 3.89 is the production code how many season numbers are there?
SQL: SELECT COUNT("season") FROM tv_episode_data_31 WHERE "production_code" = '3.89'