xxxxxxxxxx
CREATE TABLE IF NOT EXISTS [schema_name].table_name ( );
xxxxxxxxxx
CREATE TABLE IF NOT EXISTS some_table (id INTEGER PRIMARY KEY AUTOINCREMENT, );
xxxxxxxxxx
CREATE TABLE IF NOT EXISTS some_table (id INTEGER PRIMARY KEY AUTOINCREMENT, );
xxxxxxxxxx
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('your_database.db')
cursor = conn.cursor()
# Define the create table query
create_table_query = '''
CREATE TABLE IF NOT EXISTS YourTable (
id INTEGER PRIMARY KEY,
name TEXT,
age INTEGER
);
'''
# Execute the create table query
cursor.execute(create_table_query)
# Commit the changes and close the connection
conn.commit()
conn.close()