Created
December 26, 2020 07:16
-
-
Save tomlin7/eb70c5992d8d1dd53fd77461a3b71028 to your computer and use it in GitHub Desktop.
Create an sqlite database & table and insert data to it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
db = sqlite3.connect('scores.db') | |
c = db.cursor() | |
c.execute('''CREATE TABLE stocks | |
(date text, trans text, symbol text, qty real, price real)''') | |
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") | |
db.commit() | |
db.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment