The mayor of Nashville has declared a state of emergency after torrential rains flooded large areas in the Tennessee capital.