I am very new to SQL and trying to create a table using SQL with python. my first trial got an error as "data base is locked"
here are my quote, please kindly help .
import sqlite3
with sqlite3.connect("PhoneBook.db")as db:
cursor=db.cursor()
cursor.execute("""CREATE TABLE IF NOT EXISTS Names(
ID integer PRIMARY KEY, firstname text NOT NULL, surname text NOT NULL,
phonenumber text);""")
cursor.execute("""INSERT INTO Names (ID,firstname,surname,phonenumber)VALUES
("6","Simon","Howels","01223349752")""")
db.commit()
cursor.execute("""INSERT INTO Names (ID,firstname,surname,phonenumber)VALUES
("7","Karen","Philip","0954295773")""")
db.commit()
cursor.execute("""INSERT INTO Names (ID,firstname,surname,phonenumber)VALUES
("8","Darren","Smith","01583749012")""")
db.commit()
cursor.execute("""INSERT INTO Names (ID,firstname,surname,phonenumber)VALUES
("9","Anne","Jones","01323567322")""")
db.commit()
cursor.execute("""INSERT INTO Names (ID,firstname,surname,phonenumber)VALUES
("10","Mark","Smith","01223855534")""")
db.commit()
db.close()