Junior — Middle
Have you had experience using SQLite in your projects?
sobes.tech AI
Answer from AI
Yes, I have used SQLite in several projects where a lightweight, embedded database was needed without deploying a separate server. For example, for small desktop applications or prototypes where quick data storage and retrieval are required.
Example of using SQLite in Python:
import sqlite3
conn = sqlite3.connect('example.db')
cursor = conn.cursor()
# Create table
cursor.execute('''CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)''')
# Insert data
cursor.execute('INSERT INTO users (name) VALUES (?)', ('Ivan',))
conn.commit()
# Read data
cursor.execute('SELECT * FROM users')
print(cursor.fetchall())
conn.close()
This example shows how to create a simple database, insert data, and retrieve it using SQLite in Python.