import sqlite3

connection = sqlite3.connect('data.db')

cursor = connection.cursor()

# MUST BE INTEGER
# This is the only place where int vs INTEGER matters—in auto-incrementing columns
create_table = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, username text, password text)"
cursor.execute(create_table)

# Must be tuple
users = [
    ('weber', 'asdf'),
    ('lawrence', 'asdf'),
    ('eva', '1234'),
    ('penny', '1234'),
    ('sabrina', '<PASSWORD>')
]
insert_query = "INSERT INTO users VALUES (NULL, ?, ?)"
cursor.executemany(insert_query, users)

# tbl items
create_table = "CREATE TABLE IF NOT EXISTS items (name text PRIMARY KEY, price real)"
cursor.execute(create_table)

cursor.execute("INSERT INTO items VALUES ('iPhone SE', 20.99)")

connection.commit()

connection.close()
import sqlite3

connection = sqlite3.connect('data.db')

cursor = connection.cursor()

# MUST BE INTEGER
# This is the only place where int vs INTEGER matters—in auto-incrementing columns
create_table = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, username text, password text)"
cursor.execute(create_table)

# Must be tuple
users = [
    ('weber', 'asdf'),
    ('lawrence', 'asdf'),
    ('eva', '1234'),
    ('penny', '1234'),
    ('sabrina', '<PASSWORD>')
]
insert_query = "INSERT INTO users VALUES (NULL, ?, ?)"
cursor.executemany(insert_query, users)

# tbl items
create_table = "CREATE TABLE IF NOT EXISTS items (name text PRIMARY KEY, price real)"
cursor.execute(create_table)

cursor.execute("INSERT INTO items VALUES ('iPhone SE', 20.99)")

connection.commit()

connection.close()
# MUST BE INTEGER # This is the only place where int vs INTEGER matters—in auto-incrementing columns # Must be tuple # tbl items