title: insert multi values from python list into sqlite table
body: <p>I have over ten thousand of data in python list and it take over 300 seconds to add data from list into
  sqlite table.
  I would like to know how to add multi data at the same time or the fastest method to do it.</p>
  <p><code>list_example  = [('ST0001', '2020-04-11', 23.0), ('ST0002', '2020-04-11', 20.0), ('ST0003', '2020-04-11', 75.0)]</code></p>
  <p>First code version:</p>
  <pre><code>import sqlite3
  
  def add_temp_stock_data(PART_NO, INVDATE, COST):
      global conn
      global c
      conn = sqlite3.connect('PRODUCT_LIST.db')
      c = conn.cursor()
      c.execute(&quot;&quot;&quot;CREATE TABLE IF NOT EXISTS PRODUCT_LIST (
          PART_NO TEXT,
          INVDATE TEXT,
          COST REAL)
          &quot;&quot;&quot;,
              )
      with conn:
          c.execute(&quot;&quot;&quot;INSERT INTO PRODUCT_LIST (PART_NO, INVDATE, COST)
                  VALUES (?,?,?)&quot;&quot;&quot;,
                    (PART_NO, INVDATE, COST,))
      conn.commit()
  
  for i in range(len(list_example)):
      PART_NO = list_example[i][0]
      INVDATE = list_example[i][1]
      COST = list_example[i][2]
      add_temp_stock_data(PART_NO, INVDATE, COST)
  </code></pre>
  <p>Second code version:</p>
  <pre><code>def add_temp_stock_data(list_example):
      global conn
      global c
      conn = sqlite3.connect('PRODUCT_LIST.db')
      c = conn.cursor()
      c.execute(&quot;&quot;&quot;CREATE TABLE IF NOT EXISTS PRODUCT_LIST (
          PART_NO TEXT,
          INVDATE TEXT,
          COST REAL)
          &quot;&quot;&quot;,
              )
      for i in range(len(list_example)):
          PART_NO = list_example[i][0]
          print(PART_NO)
          INVDATE = list_example[i][1]
          print(INVDATE)
          COST = list_example[i][2]
          print(COST)
          with conn:
              c.execute(&quot;&quot;&quot;INSERT INTO PRODUCT_LIST (PART_NO, INVDATE, COST)
                      VALUES (?,?,?)&quot;&quot;&quot;,
                        (PART_NO, INVDATE, COST,))
      print(list_example)
      conn.commit()
  add_temp_stock_data(list_example)
  </code></pre>