Great tutorial. Here are some observation. You don't need to create a database before and place it where you are going to be executing your queries. Sqlite3 will create the database when you establish the connection if not exists. If the database does exists a connection will open it. Also, you don't want to override an existing table, I will suggest to use "CREATE TABLE IF NOT EXISTS..." this will prevent overriding a table with valuable information in it.
@TheCSClassroom
Жыл бұрын
Good points!
@yassinshaker4958
Жыл бұрын
Amazing explanation
@henrycovil2629
2 жыл бұрын
Your explanation is amazing, thank you.
@tomiwan1539
2 жыл бұрын
Every other tutorial I've seen teaches to create a cursor object and assign it to a variable, but it seems you skip this step and simply call the execute method directly from the connection object? Is there any advantage / disadvantage to either way?
@jerryhuang7194
5 ай бұрын
I guess this is just a shorthand way of doing it, probably for simplicity's sake. The use of conn.cursor() is probably a more explicit way of executing queries, which means that you can probably get a more specific error message related to the cursor object if the code or the query does not work.
@dimioo
2 жыл бұрын
Thanks for the video. I have abandoned sqlite3 module as I found peewee - nice warpper for python sqlite3 ;)
@TheCSClassroom
2 жыл бұрын
It's a great learning opportunity to use raw SQLite, but I would use a wrapper or ORM for any real-world project. Good luck!
Пікірлер: 8