text: Below is an context that describes a sql query, paired with an question that provides further information. Write an answer that appropriately completes the request.  # noqa: E501
  ### Context:
  CREATE TABLE table_name_13 (attendance VARCHAR, result VARCHAR, week VARCHAR)
  ### Question:
  What was the total attendance with a result of W 31-21 before week 9?
  ### Answer:
  SELECT COUNT(attendance) FROM table_name_13 WHERE result = "w 31-21" AND week < 9