title: creating Tables and columns dynamically using mysql python connector
body: <p>I want to create a table having columns dynamically using python list. Column Names are in the list and I want to refer them in the MySQL query. I am using MySQL.connector with python 3.4.3.</p>
  
  <p>Below is the code which I tried:</p>
  
  <pre><code>col names:  ['Last Name', 'First Name', 'Job', 'Country']
  table_name = 'stud_data'
  query = "CREATE TABLE IF NOT EXISTS"+table_name+"("+"VARCHAR(250),".join
  (col) + "Varchar(250))"
  print("Query is:" ,query)
  cursor.execute(query)
  conn.commit()
  </code></pre>
  
  <p>But I am getting the following error:</p>
  
  <pre><code>mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Name VARCHAR(250),First Name VARCHAR(250),Job VARCHAR(250),Country VARCHAR(250))' at line 1
  </code></pre>
  
  <p>The query looks like this:</p>
  
  <pre><code>Query is: CREATE TABLE IF NOT EXISTS stud_data (Last Name VARCHAR(250),First Name VARCHAR(250),Job VARCHAR(250),Country VARCHAR(250))
  </code></pre>
  
  <p>Please help on this. Thanks in advance</p>