sqlite3 — Easy Playground
Built-in SQLite database interface; no server needed
Python Playground
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()
Output
Click "Run" to execute your code
The sqlite3 module is part of Python's standard library. Built-in SQLite database interface; no server needed.
Challenge
Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?