Answers for "python sql sqlite"

SQL
6

install sqlite3 python

pip install pysqlite3
Posted by: Guest on September-12-2020
0

sqlite3 in python3

import sqlite3
con = sqlite3.connect('example.db')

cur = con.cursor()

# Create table
cur.execute('''CREATE TABLE stocks
               (date text, trans text, symbol text, qty real, price real)''')

# Insert a row of data
cur.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")

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

# We can also close the connection if we are done with it.
# Just be sure any changes have been committed or they will be lost.
con.close()
Posted by: Guest on September-15-2021
-3

how to install sqlite3 in python

$chmod +x sqlite.py
$./sqlite.py
Open database successfully
Posted by: Guest on May-19-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language