resume-analyser / database.py
tspsram's picture
Upload 20 files
8e3435c verified
raw
history blame contribute delete
506 Bytes
import sqlite3
# Create or connect to an SQLite3 database
conn = sqlite3.connect("db.sqlite3") # This creates db.sqlite3 if it doesn't exist
cursor = conn.cursor()
# Create a sample table
cursor.execute('''
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL
)
''')
# Commit changes and close connection
conn.commit()
conn.close()
print("Database and table created successfully!")