I want to learn how to build sqlite with python, after following the tutorial, I keep find this error, I do search on stackoverflow but after checking few times I still can't figure out what happened...
Here's my code:
import sqlite3
import csv
conn = sqlite3.connect("member_2.db")
cursor = conn.cursor()
# build db table
sql_command="""
CREATE TABLE member (
id PRIMARY KEY INTEGER AUTOINCREMENT,
name TEXT NOT NULL,
gender CHAR(1),
score INTEGER,
team TEXT
);
CREATE TABLE pick_history (
member_id INTEGER,
pick_time DATE DEFAULT (datatime('now', 'localtime')),
FOREIGN KEY(member_id) REFERENCES member(id)
);
"""
cursor.execute(sql_command)
Please help~Thanks!