How to correctly set AUTO INCREMENT fo a column in SQLite, using Python?

前端 未结 4 931
轻奢々
轻奢々 2021-02-04 04:33

I have been trying with the below code:

import sqlite3
data_person_name = [(\'Michael\', \'Fox\'),
                    (\'Adam\', \'Miller\'),
                           


        
4条回答
  •  感动是毒
    2021-02-04 04:58

    Try like this:

    c.execute('''CREATE TABLE q1_person_name
             (name_id integer primary key AUTOINCREMENT,
              first_name varchar(20) NOT NULL,
              last_name varchar(20) NOT NULL)''')
    

提交回复
热议问题