sqlite3
Create a Connect
connection object and employee.db (binary) if it doesn't exist
conn = sqlite.connect('employee.db')
Connect.Cursor
object
c = conn.cursor()
Connect.Cursor.execute()
. Create tablename
with fields field
of type type
(null
, integer
, real
, text
, blob
); never use Python's native string operations (f-strings, etc) to form commands, because this method is vulnerable to SQL injection. YouTube
c.execute('''CREATE TABLE {tablename} ({field} {type}, {field} {type} ...))
conn.commit()
conn.close()