Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

table in sqlite python

import sqlite3

# it will create a databse with name sqlite.db
connection= sqlite3.connect('sqlite.db')

cursor = connection.cursor()

# table name = Website 
# Table fields are 
# Post: Text type
# Autor: Text type
# Views: Real type

cursor.execute('''CREATE TABLE Website
               (Post text, Autor text, Views real)''')

# Save (commit) the changes
connection.commit()

# close connection
connection.close()
Source by www.alixaprodev.com #
 
PREVIOUS NEXT
Tagged: #table #sqlite #python
ADD COMMENT
Topic
Name
6+2 =