title: A way to iterate creation of new SQL tables using a column from another SQL table?
body: <p>My program aims to take values from an existing table and create a new table named from those values. I was able to check if it iterates with <code>print()</code>  but once I input <code>cur.execute()</code>, the program only makes the first table and then stops. What am I missing?</p>
  <pre><code>import sqlite3
  
  
  conn = sqlite3.connect('PSEIraw.sqlite')
  cur = conn.cursor()
  
  cur.execute('''SELECT STOCK_CODE FROM psei_raw''')
  row = cur.fetchone()
  for row in cur:
      stockcode='''CREATE TABLE IF NOT EXISTS &quot;''' + row[0] + '''&quot; (Date DATE, Open DECIMAL, High DECIMAL, Low DECIMAL, Close Decimal, Volume DECIMAL)'''
      cur.execute(stockcode)
  
  conn.commit()
  </code></pre>
  <p><strong>EDIT 1</strong>
  I plan on getting at most 50 rows per stock for stdev computations and volume comparisons. I know that designwise, this isn't the best but that's the process i am in now. Gist is to download EOD for all stocks in our exchange (200+ stocks) and have OHLC and volume that inserted per stock table.</p>
  <p><strong>EDIT 2</strong></p>
  <p>Done. just iterated and stored in a list then iterated again to make tables.</p>