human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: No. in season, No. in series, Title, Canadian airdate, US airdate, Production code
###Question: How many titles had production code 1040?
gpt
SELECT COUNT Title FROM table WHERE Production code = 1040