How to connect Python with a SQL database [SQLITE] | perfect for beginners

preview_player
Показать описание
Learn how to connect Python to a SQL database using the sqlite library.
I am planning on another one covering topics like data frame handling in SQL which I consider to be pretty important and I think ORM is also an interesting topic.

Forgot an important thing: Close the connection once you are done with your stuff:

If you have any questions please feel free to drop me comment.

Thank you very much for watching :-)

You can download the DB Browser here:

Regarding bad practice:
There is a much better way to use OOP in connection with databases which is referred to as ORM (object-relational mapping). I will do a video on that in the future.

0:00 - 0:47 Brief Introductory Talk (skippable)
0:47 - 02:22 Connecting Python with a new database
02:22 - 03:25 Sqlite Datatypes
03:25 - 04:35 DB Browser (Database "Interface" - optional!)
04:35 - 06:40 Create Tables
06:40 - 08:30 Insert Values into a Table
08:30 - 09:35 Querying the Database (SELECT statement)
09:35 - 11:05 fetchall() and fetchone() / multiple rows
11:05 - 11:28 Iterating over the cursor
11:28 - 12:55 Inserting Python variables into a SQL table
12:55 - 13:58 Flexible inputs
13:58 - 15:40 Using a constructor (OOP) to fill tables (bad practice see description)
15:40 - 16:01 Up Next / Thanks for watching :-)
Рекомендации по теме
Комментарии
Автор

Just discovered the channel. Great coding examples and no beating around the bush. Keep up the good work!

dariusbotusanu
Автор

Your videos are great! Thank you.
One small tip for PyCharm users. Please input instead of cursor.fetchall()

anuartreasurer
Автор

Great job, incredible help due to crystal clear explanations! Thank you! Keep it up, already subscribed

cristidragosmatei
Автор

seems figuring out random first and last names more difficult than creating database itself for you :), by the way, thank you for your great work!

shunlyu
Автор

Super Video, viel gelernt. Gruß aus Berlin.

barneyharper
Автор

Your channel is incredible man. This is the first time I ever felt like SQL could be simple. And the other videos aswell! Thank you so much and waiting for more to come

BOSprodz
Автор

What an incredible help - thank you so much for your incredible work, mate!

AbCdEf-vhjj
Автор

Thanks! Looking forward for the next SQL+Python video:)

kateryna
Автор

Love your channel bro....the videos and teaching are top notch! really looking forward to more

nishadseeraj
Автор

this was awesome. thank you. easy to understand and do for a newbie

solvability
Автор

Awesome - Brief & clear Danke + Grüß

ioannisakingonte
Автор

Nice! BUT I would have preferred salary as UNREAL number!

GeeNee
Автор

hello, you did not want to demonstrate the commands delete and update ?

marcosantonioamonteiro
Автор

Love your Videos. Greetings from Germany, are you german btw? Your accent seems sort of german

thieshenningsen
Автор

Can you make a tutorial on bot because I don't know which video to begin with out of all this.

compiversity
Автор

Bro can you create a video for using sqlciper

kaakash
Автор

many times my data base is locked how can i solve that problem ?

juanignacioclaveriaolavarr
Автор

why do i gett NameError: name 'connection' is not defined?

eueinraissa
Автор

I am trying from two
Hours my one every time says table already exist just follow all ur video iam v confused

miansafyankhan
Автор

Where can I contact you ? I cant find an email address

randomdude