Skip to content
UPEEC

sqlite3

The built-in driver for SQLite, a full SQL database in a single file.

Beginner
Comments 0
import sqlite3
con = sqlite3.connect("lab.db")
con.execute("CREATE TABLE IF NOT EXISTS r (t TEXT, v REAL)")
con.execute("INSERT INTO r VALUES (?, ?)", ("2026-10-23", 3.3))
con.commit()

Use ? placeholders — never format values into SQL strings.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.