Use the cursor.executemany() method to insert a sequence of rows in one go:

query_string = 'INSERT INTO sample VALUES (?, ?, ?)'

c.executemany(query_string, array2d)
conn.commit()


Don't forget to conn.commit() the transaction.

I've not bothered with formatting the SQL parameters here, for demonstration purposes; you don't really want to do so here anyway, as your number of columns is fixed at well (from the CREATE TABLE definition).

multidimensional array to database in python
Newbie question.

Why is it that there's a bazillion different types of screws? Why can't we just always use one standard screw type? Are there advantages/disadvantages to the different types? Are there times when one type is preferred over another?

Help me understand why there isn't one screw to rule them all.
