title: MySQL Python creating table with variable as name
body: <p>I am working on a project with a friend and am new to sql databases. I want to have a database with tables named after the date they were created. I have tried multiple things but i thought .format() would be the best, but it didnt work. This is how it currently looks:</p>
  
  <pre><code>today = date.today()
  d1 = today.strftime("%b-%d-%Y")
  sql = "CREATE TABLE {table} (CEO VARCHAR(255), profits INTEGER(10))"
  mycursor.execute(sql.format(table = d1))
  </code></pre>
  
  <p>i am also trying to insert into the database with .format:</p>
  
  <pre><code>sql = "INSERT INTO{table} (CEO, profits) values (%s, %s)"
  mycursor.execute(sql.format(table = d1), (Company(c).get_CEO(), int(Company(c).get_profit())))
  mydb.commit()
  </code></pre>
  
  <p>I get the error: </p>
  
  <blockquote>
    <p>mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax;</p>
  </blockquote>