SQLite with Python

Built-in database support

Interview Relevant: Basic database

SQLite

Lightweight disk-based database.

Code Examples

python
1import sqlite3
2conn = sqlite3.connect('example.db')
3c = conn.cursor()
4c.execute('CREATE TABLE IF NOT EXISTS users (id INT, name TEXT)')
5c.execute('INSERT INTO users VALUES (1, "Alice")')
6conn.commit()
7conn.close()

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In