sqlite3

Stdlib — DatabasePython 2.5+Intermediate

Built-in SQLite database interface; no server needed

Quick Info

Documentation
Official Docs
Python Version
2.5+
Dependencies
None — Python Standard Library
Install
Included with Python

Learn by Difficulty

Quick Example

python
import sqlite3

conn = sqlite3.connect(":memory:")
cursor = conn.cursor()
cursor.execute("CREATE TABLE users (name TEXT, age INTEGER)")
cursor.execute("INSERT INTO users VALUES ('Alice', 30)")
cursor.execute("INSERT INTO users VALUES ('Bob', 25)")
cursor.execute("SELECT * FROM users")
print(cursor.fetchall())
conn.close()

The sqlite3 module is part of Python's standard library. Built-in SQLite database interface; no server needed.

Try in Playground

Tags

stdlibdatabasesqlpersistencefile-io

Related Items