Skip to content

Instantly share code, notes, and snippets.

@nagos
Last active November 29, 2022 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nagos/90514d4069a1a155bd489b85ee217e39 to your computer and use it in GitHub Desktop.
Save nagos/90514d4069a1a155bd489b85ee217e39 to your computer and use it in GitHub Desktop.
#!/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