Answer the question
In order to leave comments, you need to log in
How to write all queries in one in sql?
cursor.execute("""CREATE TABLE IF NOT EXISTS information
(id INTEGER PRIMARY KEY AUTOINCREMENT,userid INTEGER,money INTEGER,weight INTEGER,sportmode INTEGER)
""")
cursor.execute("""CREATE TABLE IF NOT EXISTS task
(id INTEGER PRIMARY KEY AUTOINCREMENT,list TEXT, status INTEGER)
""")
cursor.execute("""CREATE TABLE IF NOT EXISTS what
(mycommands TEXT)
""")
cursor.execute("""CREATE TABLE IF NOT EXISTS accounts
(login TEXT, password TEXT, token TEXT)
""")
Answer the question
In order to leave comments, you need to log in
Maybe so?
cursor.execute("""CREATE TABLE IF NOT EXISTS information
(id INTEGER PRIMARY KEY AUTOINCREMENT,userid INTEGER,money INTEGER,weight INTEGER,sportmode INTEGER);
CREATE TABLE IF NOT EXISTS task
(id INTEGER PRIMARY KEY AUTOINCREMENT,list TEXT, status INTEGER);
CREATE TABLE IF NOT EXISTS what
(mycommands TEXT);
CREATE TABLE IF NOT EXISTS accounts
(login TEXT, password TEXT, token TEXT)
""")
SQLite3??
Cursor object methods SQLite3
cursor.executescript(sql_script)
UPDATE:
either like this for example:
sql_script = """
CREATE TABLE IF NOT EXISTS information
(id INTEGER PRIMARY KEY AUTOINCREMENT,userid INTEGER,money INTEGER,weight INTEGER,sportmode INTEGER);
CREATE TABLE IF NOT EXISTS task
(id INTEGER PRIMARY KEY AUTOINCREMENT,list TEXT, status INTEGER);
CREATE TABLE IF NOT EXISTS what
(mycommands TEXT);
CREATE TABLE IF NOT EXISTS accounts
(login TEXT, password TEXT, token TEXT)
"""
for sql in sql_script.split(";\n"):
cursor.execute(sql)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question