Last active
November 29, 2022 07:40
-
-
Save nagos/90514d4069a1a155bd489b85ee217e39 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
# https://docs.python.org/3/library/sqlite3.html | |
import sqlite3 | |
con = sqlite3.connect("tutorial.db") | |
cur = con.cursor() | |
cur.execute("CREATE TABLE movie(title, year, score)") | |
cur.execute(""" | |
INSERT INTO movie VALUES | |
('Monty Python and the Holy Grail', 1975, 8.2), | |
('And Now for Something Completely Different', 1971, 7.5) | |
""") | |
res = cur.execute("SELECT * FROM movie") | |
print(res.fetchone()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment