Python 如何将数组插入sqlite数据库

Python 如何将数组插入sqlite数据库,python,database,sqlite,Python,Database,Sqlite,我有这个数组 stokmiktarı[ ]= {04.08.2019,"Stok Miktarı",40,50,60} 我想像这样将这个数组插入sqlite数据库 ------------------------------------------------------------- Tarih | Isim | A Store | B Store | C Store | -----------------------------------

我有这个数组

stokmiktarı[ ]= {04.08.2019,"Stok Miktarı",40,50,60}
我想像这样将这个数组插入sqlite数据库

-------------------------------------------------------------
Tarih      |     Isim      |   A Store   |   B Store   |   C Store  |
-------------------------------------------------------------
04.08.2019 |  Stok Miktarı |     40      |      50     |      60    |
在python中如何实现这一点请帮助我,谢谢

import sqlite3

db = sqlite3.connect(':memory:') # creates db in RAM
cursor = db.cursor()
cursor.execute('''
    CREATE TABLE stores_info(id INTEGER PRIMARY KEY, tarih DATE,
                 isim TEXT, a_store TEXT, b_store TEXT, c_store TEXT)
''')
db.commit()

stores = [
    ['04.08.2019', 'Stok Miktarı', 40,50,60],
    ['05.07.2019', 'Stok Miktarı 2', 41,51,61],
    ['06.11.2019', 'Stok Miktarı 3', 40,50,60]
]
cursor.executemany('''
    INSERT INTO stores_info(tarih, isim, a_store, b_store, c_store) VALUES(?,?,?,?,?)
''', stores)
db.commit()

# retrive result
cursor.execute(''' SELECT tarih, isim, a_store, b_store, c_store FROM stores ''')
# cursor.fetchone() # retrieves the first row
result = cursor.fetchall()
for row in result:
    print row[0], row[1], row[2], row[3], row[4]
这是输出

# by inserting a_store, b_store & tarih to db
05.07.2019 41 51
04.08.2019 40 50

您已经创建了数据库和表来存储这些数据了吗?

您使用的是django/flask…不是这个cmd应用程序吗?这里是一个示例,很抱歉,但ı不理解示例A