title: Optimal SQL query for querying 31 tables (containing datestamp in tablename)
body: <p>Fairly new to SQL and I was stumped on this question I received in an interview recently. </p>
  
  <p>The question was along the lines of how would you count the total occurrences of 'True' for Column B in July. </p>
  
  <p>Problem was; there was no date or timestamp column in the table. Instead the table naming convention was defined as "ProductX_YYYYMMDD". The assumption being that a new table is created for each day's data dump.  </p>
  
  <p>Is there an efficient query I can write to obtain the True COUNTs of Column B for each table (which doesn't involve ~30 JOIN or UNION statements to get the answer)? </p>