Open
Description
Following the sqlite3
docs at https://docs.python.org/3/library/sqlite3.html, an error is raised when trying to query a SQLite database:
# Using the example code from
#https://docs.python.org/3/library/sqlite3.html
import sqlite3
con = sqlite3.connect("tutorial.db")
cur = con.cursor()
cur.execute("CREATE TABLE movie(title, year, score)")
res = cur.execute("SELECT name FROM sqlite_master")
Throws error:
---------------------------------------------------------------------------
DatabaseError Traceback (most recent call last)
Cell In[2], line 11
7 cur = con.cursor()
9 cur.execute("CREATE TABLE movie(title, year, score)")
---> 11 res = cur.execute("SELECT name FROM sqlite_master")
DatabaseError: database disk image is malformed