Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

insert data in sqlite database in python

import sqlite3
# it will create a databse with name sqlite.db
connection= sqlite3.connect('sqlite.db') 
cursor= connection.cursor()
table_query = '''CREATE TABLE Student
               (Name text, Course text, Age real)'''
               
cursor.execute(table_query)
# you need to commit changes as well
connection.commit()
# you also need to close  the connection
connection.close()   
Source by www.alixaprodev.com #
 
PREVIOUS NEXT
Tagged: #insert #data #sqlite #database #python
ADD COMMENT
Topic
Name
6+3 =