I am making a shopping list program for my mum with Python, SQLite3 and Bottle,
I am making a table to put all my items into but the item_id
with AUTOINCREMENT
on the column it doesn't work:
c.execute("""CREATE TABLE categories (
category_id INTEGER NOT NULL,
category_name TEXT PRIMARY KEY NOT NULL)""")
c.execute("""CREATE TABLE products (
item_name TEXT PRIMARY KEY NOT NULL,
item_category_id INTEGER NOT NULL)""")
c.execute("""CREATE TABLE shopping_products (
item_id INTEGER AUTOINCREMENT,
item_name TEXT PRIMARY KEY NOT NULL,
item_category_id INTEGER NOT NULL,
item_quantity INTEGER NOT NULL,
item_date INTEGER NOT NULL)""")
On the shopping_products
table the AUTOINCREMENT
keep returning this error:
sqlite3.OperationalError: near "AUTOINCREMENT": syntax error