CREATE TABLE table_name_52 (opponent VARCHAR(255), record VARCHAR(255), october VARCHAR(255), game VARCHAR(255))
What is the Opponent before October 31 with a Record of 2-3-1 after Game 5?
    
SQL: SELECT opponent FROM table_name_52 WHERE october < 31 AND game > 5 AND record = "2-3-1"