import sqlite3
with sqlite3.connect("test.db") as db:
cursor = db.cursor()
cursor.execute("""CREATE TABLE IF NOT EXISTS art(
id INTEGER PRIMARY KEY AUTOINCREMENT,
auth VARCHAR
topic VARCHAR,
content TEXT
)""")
values = [("a1", "t1?", "c1"),
("a2", "t2", "c2"),
("a3", "t3", "c3")]
cursor.executemany('INSERT INTO art(auth, topic, content) VALUES(?, ?, ?)', values)
cursor.execute('SELECT * FROM art')
print(cursor.fetchone())
При попытке запуска выдает ошибку:
cursor.executemany('INSERT INTO art(auth, topic, content) VALUES(?, ?, ?)', values)
sqlite3.OperationalError: table art has no column named topic