Python Basics Tutorial Sqlite Primary Key Auto Increment

preview_player
Показать описание
Learn how to set-up and use a primary key from sqlite for python programming

Patreon:
Github:
Discord:
Twitter:
twitter: @python_basics

#pythonprogramming #pythonbasics #pythonforever
Рекомендации по теме
Комментарии
Автор

Thank you for clear answer. Looking through the forums I have not found out it is possible to insert to certain columns in order to autoincrement. That's what I needed.

geektactics
Автор

Thank you for explaining the use of Primary key and showing the error w/o try/except

joejones
Автор

I have set id as my primary key in MySQL but when I execute the insert command, None value is added to the database. What should I do?

GlobalSpotlight
Автор

Hi, thanks for the video. But I keep getting this error:
sqlite3.OperationalError: table test has 7 columns but 6 values were supplied

I have dropped the table many times, but the primary key has to be supplied. It is not autoincrementing. I tried to use the AUTOINCREMENT keyword, but it is not working. Can you please have any clues? Thanks in advance

ndas_adriana
Автор

Simple fast and accurate this tutorial tks

RodrigoSilva-mhdk
Автор

i had write id primary key autoincrement but it didn't work also didn't throw any error and i had take input from user so did it effect it

vishalvarma
Автор

I have been trying this with sqlite for a while and I get " line 15, in <module>
cur.execute('INSERT INTO my_table(col_1, col_2) values(?, ?)', nums)
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 2, and there are 3 supplied.
" from the code used in this demo.

I figured it out I had to use the cur.executeman instead of cur.execute

raymondmonroe
Автор

DB browser is good to help you visualise DB's ! tyvm

raphaelmayer
join shbcf.ru