This is my code (from the "Python for Data Analysis" book):
import sqlite3
query = """ CREATE TABLE test (a VARCHAR(20), b VARCHAR(20)), c REAL, d INTEGER); """
con = sqlite3.connect('mydata.sqlite')
con.execute(query)
This is the error I get:
OperationalError Traceback (most recent call last)
<ipython-input-223-702795376e74> in <module>()
1 con = sqlite3.connect('mydata.sqlite')
----> 2 con.execute(query)
OperationalError: near ",": syntax error
I tried with single and triple quotes around the code, checked the commas, but I can't figure out whats wrong.