bb
import sqlite3
def create_database():
conn = sqlite3.connect("test.db") # Creates the database file if it doesn't exist
conn.execute('''CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY,
name TEXT,
age INTEGER
)''')
conn.commit()
conn.close()
print("Database and table created successfully!")
if __name__ == "__main__":
create_database()
Comments
Post a Comment