Python SQLite Tutorial: Complete Overview - Creating a Database, Table, and Running Queries

  Рет қаралды 997,598

Corey Schafer

Corey Schafer

Күн бұрын

In this Python SQLite tutorial, we will be going over a complete introduction to the sqlite3 built-in module within Python. SQLite allows us to quickly get up and running with databases, without spinning up larger databases like MySQL or Postgres. We will be creating a database, creating a table, insert, select, update, and delete data. Let's get started...
The code from this video can be found at:
github.com/Cor...
✅ Support My Channel Through Patreon:
/ coreyms
✅ Become a Channel Member:
/ @coreyms
✅ One-Time Contribution Through PayPal:
goo.gl/649HFY
✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey's Public Amazon Wishlist
a.co/inIyro1
✅ Equipment I Use and Books I Recommend:
www.amazon.com...
▶️ You Can Find Me On:
My Website - coreyms.com/
My Second Channel - / coreymschafer
Facebook - / coreymschafer
Twitter - / coreymschafer
Instagram - / coreymschafer
#Python

Пікірлер: 574
@davorm4634
@davorm4634 7 жыл бұрын
A Nobel prize for Python education!
@ericervin2513
@ericervin2513 4 жыл бұрын
Corey is the best!
@Codeandventure
@Codeandventure 2 жыл бұрын
He’s quite magical
@zhabiboss
@zhabiboss 2 жыл бұрын
No videos?
@antwanwimberly1729
@antwanwimberly1729 Жыл бұрын
💯
@tictoktrending7184
@tictoktrending7184 4 жыл бұрын
The Award of "Best sqlite tutorial on KZbin " goes to Corey Schafer 👏👏👏
@JMEPatterson
@JMEPatterson 5 жыл бұрын
You had me at "SQLite is actually part of the standard library"!
@standinginthelimelight
@standinginthelimelight 3 жыл бұрын
same I didn't expect that lol
@julianmahler2388
@julianmahler2388 3 жыл бұрын
He had me at "hey there, how's it going everybody?"
@1cannon3
@1cannon3 5 жыл бұрын
1:00 - Start of video 1:38 - SQLite tutorial begins 1:45 - Overview of the application to build 2:10 - You need to create a "connection" variable to represent database 2:22 - How and where to store your database 2:38 - Using a filename to store your database 3:47 - Creating a cursor (This allows you to execute sql commands) 4:10 - Creating our table and the .execute() method 4:15 - Creating the Employee table 6:37 - Committing db changes and closing db connection 7:45 - How to add data to db 8:12 - INSERT INTO VALUES() command 8:45 - Query db for the employee we just added 8:50 - Select statement 8:50 - SELECT * FROM employees WHERE LAST='Shafer' 9:35 - .fetchone(), .fetchmany(), .fetchall() 11:12 - Adding another employee to the db and querying employee table 12:19 - Start using the Employee class 14:20 - Adding Python Employee() objects to db 15:55 - Correct way to add Python objects to db 16:01 - Option 1 (db API placeholder via ?) 17:03 - Option 2 (db API placeholder via dictionary keys and values) 22:57 - Prototyping CRUD functions 23:42 - Insert employee function 25:11 - Get employee 26:03 - Update pay function and delete employee function
@YourLocalSoftwareEng
@YourLocalSoftwareEng 5 жыл бұрын
god bless you and you family this video is very long
@haroldinho4439
@haroldinho4439 5 жыл бұрын
So superheroes do exist !!! ^^^
@sahajanrajan3136
@sahajanrajan3136 5 жыл бұрын
thank you so much dear for your kindness!!god bless you!!!
@MrMitror
@MrMitror 5 жыл бұрын
Thanks man
@VetsFleetNY
@VetsFleetNY 4 жыл бұрын
You're the best jacob
@michaelfresco2769
@michaelfresco2769 7 жыл бұрын
You really cannot ask for a better tutorial than this. Absolutely fantastic. I like it how Corey pickups up the pace a bit at the end, and also gives us some practical functions, which show you how you'd use this in real life.
@scienceblossom6197
@scienceblossom6197 4 жыл бұрын
This is a 28 minute video in which every minute (or every second in 28:43 to be more precise) has been used on amazing non-BS stuff. Thank you Corey your teaching levels are outstandingly higher than everyone else I've learned something from!
@khan5195
@khan5195 2 жыл бұрын
That was exactly any newbie Pythonian could ask ! I feel like I have completed my whole uni semester in 29 minutes. Thanks mate !
@5starkarma
@5starkarma 6 жыл бұрын
I am usually shocked if the best Python tutorials on, well, anything, can't be found on your page. You are an amazing teacher with great talent. Thank you for all your work.
@Luis_Fernando_Pouliot_Madero
@Luis_Fernando_Pouliot_Madero 4 жыл бұрын
You teach so many things in only 29 minutes, so clear. Voice, image, sound, simplicity, direct to matter. Great! ☑☑☑☑☑
@davidschroeder2732
@davidschroeder2732 Жыл бұрын
Another outstanding presentation from Corey. One of the VERY BEST teachers on the internet.
@PaoPaw098
@PaoPaw098 5 жыл бұрын
My man teaching not only how to do the basic stuff but also what we can apply on a real world project (security, best practices etc.) you're the best.
@chiragpalan9780
@chiragpalan9780 3 жыл бұрын
Nothing can be better than learning Sqlite3 at 2.30AM without any prior knowladge of SQL !!!!!
@Kurende_SA
@Kurende_SA 2 ай бұрын
lol i can relate! 2:14AM
@BeeBee--
@BeeBee-- 4 жыл бұрын
I had to pause this vid midway to watch your OOP Tutorials 1 and 2. Your videos are consistently well-made that I could bounce off different tutorials and easily integrate them with the current lesson. Kudos!
@IyamwhoIyam
@IyamwhoIyam 7 жыл бұрын
You are very clear and your approach is spot on. Keep it up! We need you!
@basetroll1627
@basetroll1627 5 жыл бұрын
No book can replace your fantastic videos! For years(embarrassing) I've put all my data into huge arrays because I had horror of databases. With your video, so clear and understandable presented, I will now dive into it.
@aarongrant1184
@aarongrant1184 3 жыл бұрын
DEAR COREY SCHAFER, HOW DO YOU ALWAYS ALWAYS ALWAYS SAVE MY DAY? thanks again!
@drakZes
@drakZes 7 жыл бұрын
I LOVE YOU, finally someone who explains their code and not only code so we can actually understand it. THANK YOU SO MUCH!
@paymeintrident
@paymeintrident 2 жыл бұрын
Couldn’t understand this topic for the life of me… and you come along and speak clearly and in simple terms and it makes so much sense !
@ahmedl8574
@ahmedl8574 3 жыл бұрын
Dude is a literal legend, ain't been this amazed in agesss by a tutorial
@Unfettered_Braid
@Unfettered_Braid 2 жыл бұрын
5 years later and this was still amazing! Thank you!
@PedroHenrique-no1sr
@PedroHenrique-no1sr 3 жыл бұрын
this is the best sqlite3 tutorial on youtube, the way you explain things are very clear and easy to understand. Great job
@justforwork5343
@justforwork5343 3 жыл бұрын
omg i love this, after searching for more than 2 hours i finally found an awesome tutorial
@kaduflutist
@kaduflutist 3 ай бұрын
An excellent video and python/sqlite3 teaching technique which when followed along you end up getting the same result as the coach's. I took it on a STEP-BY-STEP basis and it worked perfectly here. Thank you very much, Corey!
@amyst815
@amyst815 6 жыл бұрын
Simply one of the best Python tutorials out there, so good it forced me to put my first comment out here :) ... thank you Corey!
@devrubic
@devrubic 4 жыл бұрын
One of the best tutorials ever. After a long time I wasn't confused on learning something new and wasn't also bored to leave it! AWESOME
@abigailmacdonald3698
@abigailmacdonald3698 5 жыл бұрын
A little floored by how informative your tutorials are. Thanks a lot!
@omerfarukmerey
@omerfarukmerey 4 жыл бұрын
I am studying computer science in a crazy school where they teach you a little bit of something and give you huge homeworks. You have helped me a lot with this video. Thank you so much!
@ethanbautista6344
@ethanbautista6344 Жыл бұрын
You are literally better than all professors combined in my entire school. Thank you for this knowledge sir
@elliotwilens4859
@elliotwilens4859 4 жыл бұрын
Best SQLite tutorial on the internet! I've been searching for days & finally understand it. Thank you
@allansifuna8844
@allansifuna8844 6 жыл бұрын
Your tutorials are incredible they have seen me grow from a noobie to advanced
@adityapaithon6499
@adityapaithon6499 6 жыл бұрын
Checkout my channel too for some cool Python tutorials
@VictorMongi
@VictorMongi 7 жыл бұрын
This tutorial is a Gem, seriously.... God Bless You Corey... keep making great stuff mannnn....
@mayankinani2158
@mayankinani2158 4 жыл бұрын
Best place to find out about python modules and actually understanding them.
@imnodl
@imnodl 4 жыл бұрын
Thank you so much for making my life so much easier, I had no idea you could use triple quotes to write multiple line strings without having to use '/n'. This greatly improved my code's readability. Also, thanks a bunch for all of these free tutorials, they're absolutely fantastic!
@vishalraj3762
@vishalraj3762 5 жыл бұрын
Awesome video!! Short, concise & to the point. I never thought learning SQLite would be so much easy and fun with Python. Great Job, Corey!! Keep posting videos like this.
@tntcaptain9
@tntcaptain9 4 жыл бұрын
Loved the tutorial, especially the part where you made the functions for performing same SQL operations again and again
@benignexistence4558
@benignexistence4558 2 жыл бұрын
Haven't even watched it yet but I thank you for not making it a combo tutorial with SQL. Too many tutorials have too much going on, thanks for employing the KISS method the way it should be. edit: posting this comment the first time it just said "returned error" how fitting
@Brandon-bm7hp
@Brandon-bm7hp 7 жыл бұрын
I love your videos They do not turn into a big mess like others they get straight to the point like it should be!
@oleggaidukov4927
@oleggaidukov4927 5 жыл бұрын
you are the God from pedagogical IT universe, man
@stevenmccarther5836
@stevenmccarther5836 3 жыл бұрын
Was looking for a video to help me use SQLITE with Jupyter . I learned a lot with this video , Thanks Mr. Schafer
@Keval_ek_insaan
@Keval_ek_insaan 6 жыл бұрын
You are amazing Teacher Corey! Your teaching skills are really appreciative. One of the best videos for python. Thanks you soo much.
@-sahlamahla2270
@-sahlamahla2270 6 жыл бұрын
You're a hero! I love the way you explain things. Thanks a lot
@moadhoueslati6838
@moadhoueslati6838 3 жыл бұрын
From tunisia ???
@KleinmeisterPang
@KleinmeisterPang 7 жыл бұрын
Great video, I am using Python with SQLite at work and educated myself with Coreys Videos,.. thanks man :)
@vitisanity
@vitisanity 6 жыл бұрын
Excellent teaching skill. I understand how to mix class tuples and database at the same time. Many thanks.
@basetroll1627
@basetroll1627 5 жыл бұрын
Me too, excellent explanation.
@giahmed82
@giahmed82 4 жыл бұрын
Excellent step by step explanation. Really love the way you have explained. Hoping to watch more of your videos.
@jerwinsamuel
@jerwinsamuel 6 жыл бұрын
Clear choice of words. Your teaching skills are amazing.
@OrientalMelodies2010
@OrientalMelodies2010 6 жыл бұрын
Your way of explaining the subject is outstanding!
@jjatuljain
@jjatuljain 3 жыл бұрын
This one is one of the best tutorials I have gone through.. Thanks Corey !!
@PavelSTL
@PavelSTL 4 жыл бұрын
I have access to a class conducted by Python professionals that my company paid for. I couldn't do it, I said screw it and I came here, this is so much better.
@timo_b3
@timo_b3 3 жыл бұрын
all this years and no one told me that there are serverless databases. thank you
@sairajdas6692
@sairajdas6692 6 жыл бұрын
God gifted teaching skills . Wow thank you .
@shanerigsby9030
@shanerigsby9030 7 жыл бұрын
So glad I found this video as my first look at SQLite--perfect level of instruction. Hoping to find a bunch more from you.
@zeinelmokhtar4105
@zeinelmokhtar4105 5 жыл бұрын
While True: Print(" Corey Schafer, YOU ARE MAKING THE WORLD A BETTER PLACE. Thank You Very Much ")
@rafalelele
@rafalelele 6 жыл бұрын
Mr. Shafer, thank you very much for your tutorial. It's so clear and enlightening. I rewrote one of my script using SQLite to store records and query, which is more efficient than my previous approach (to store data in excel via openpyxl and search cell from the whole worksheet). Much appreciated.
@ReasonablyRetro
@ReasonablyRetro 2 жыл бұрын
Very helpful overview! Really helped understand the language and I knew almost nothing before. One small step forward. Thanks!
@wintats5650
@wintats5650 4 жыл бұрын
Thank you so much Corey for taking the time to explain every detail. You are a blessing, be blessed!!
@Yasharvl
@Yasharvl 4 жыл бұрын
A super SQLite-3 jump start video! Thank you again Corey!
@agaby18
@agaby18 2 жыл бұрын
Thank you! That's precisely what i need to understand the py approach to sqlite3.
@MobCat_
@MobCat_ 3 жыл бұрын
19:06 I don't remember what its called but you can also use a c insert variables into things.. thing c.execute(f"INSERT INTO employees VALUE ('{emp_2.first}', '{emp_2.last}', '{emp_2.pay}')") the f before the "" is the important bit. print(f"Name: {emp_2.first}") Thanks for the awesome video as well.
@piotrmazgaj
@piotrmazgaj 2 жыл бұрын
Nooo... we can't it was said. That this method is prone to SQL Injection attacks and won't worki in this case. Those are f-strings.
@amirilifee
@amirilifee 4 жыл бұрын
Nice video man. Dont stop doing same videos, bcoz we need them.)))
@aldehc99
@aldehc99 2 жыл бұрын
Totally fascinating learning video to watch.
@cd1168
@cd1168 5 жыл бұрын
Excellent. The functions really made it worth while.
@dLantee
@dLantee Жыл бұрын
Wonderful video! Very clear, easy to follow. Very good teaching!
@gatuaprof5396
@gatuaprof5396 3 жыл бұрын
Nice work, buddy. I do not easily subscribe to channels, with the crystal clear demo, i had too.
@ibrahimal-mahfooz8737
@ibrahimal-mahfooz8737 4 жыл бұрын
Wallahi you are the best teacher ever!
@JJohnny224
@JJohnny224 3 жыл бұрын
That's a great video, I'm building a small project for my summer class and SQLite is perfect for it. Thanks!
@iamakifislam
@iamakifislam 4 жыл бұрын
🖤 You are the best teacher of Python
@narendrar9940
@narendrar9940 6 жыл бұрын
Wow! It was so precise, informative and all encompassing . I really enjoyed it. Thank you very much.
@BlackBlingGirl
@BlackBlingGirl 3 жыл бұрын
Wooooow ! Thank you this is exactly what I needed for my new project ! Amazing Video and the explanations are on point !
@janzaibmbaloch5484
@janzaibmbaloch5484 5 жыл бұрын
A very nice and hands on intro. Kudos
@nilupulperera
@nilupulperera 4 жыл бұрын
Excellent tutorial. Everything in one simple video. Thank you so much.
@youcefyahiaoui1465
@youcefyahiaoui1465 6 жыл бұрын
Why! Super amazing teaching. I love Corey Schafer's tutorials.
@sessdu
@sessdu 5 жыл бұрын
I liked each of your tutorial I had watched, great works
@Chickin
@Chickin 3 жыл бұрын
8:46 when your step sis walk in while you're making a tutorial
@sameerk12982
@sameerk12982 6 жыл бұрын
Thank you very much sir for creating such an informative clear video for sqlite.
@calebtallquist3932
@calebtallquist3932 4 жыл бұрын
These videos are so well explained and VERY helpful and informative!
@davidthompson3876
@davidthompson3876 4 жыл бұрын
Excellent video. Just the right speed for me. Thanks.
@iansharp1171
@iansharp1171 5 жыл бұрын
You are a gifted teacher. thankyou.
@jonathangeorge5814
@jonathangeorge5814 3 жыл бұрын
I liked your explanation. They're clear and detailed. Well done video as a whole sir :)
@suyash.01
@suyash.01 3 жыл бұрын
As always, to the point and straightforward. Thanks my man!
@Zero-lb1zm
@Zero-lb1zm 4 жыл бұрын
This a really good tutorial Corey, thanks for all the workings and explainations.
@adamsykes3792
@adamsykes3792 4 жыл бұрын
Super Easy To follow and im 13, great tutorial now i can say i can use sql lite in pychaarm
@skanda5206
@skanda5206 3 жыл бұрын
Great explanation. He goes through everything in detail
@kamranmoazzamansari7289
@kamranmoazzamansari7289 6 жыл бұрын
Breaks down things. Finally found a great video.
@ninjaboyjames
@ninjaboyjames 2 жыл бұрын
Bro you are carrying my computer science class
@profreed
@profreed 3 жыл бұрын
really helpful! Thank you so much. I need a quick straightforward intro and that was great. Highly recommend!
@yunakamura
@yunakamura 4 жыл бұрын
I should have reached this video before I accidentally went into thinking I should start with Mysql... Anyway, thanks a lot!!!
@Harshhification
@Harshhification 4 жыл бұрын
Wow, such a detailed explanation! Subscribed!!
@_jdfx
@_jdfx 5 жыл бұрын
amazing! such clear explanations, best every 30min video!
@trying2understand870
@trying2understand870 6 жыл бұрын
Thank you so much Corey, really enjoy learning python from you. You are very good at explaining the minutia.
@johnchessant3012
@johnchessant3012 2 жыл бұрын
Glad I found this, it was extremely helpful and clear
@anuragkadam7935
@anuragkadam7935 Жыл бұрын
Awesome channel, awesome work. Whatever i earn from my programming skills, i owe it to you. 🙌🏿✨
@khaled-dz8357
@khaled-dz8357 6 ай бұрын
I wasreally wondering how tolearn hard SQLLITE and databases in genreal. You have broke down and make it like chees for me. Thanks Corey
@CWW9000
@CWW9000 4 жыл бұрын
Excellent, well-constructed tutorial, very useful for the data science project I'm working on, many thanks man, keep it up. -Ben
@zacstrick6133
@zacstrick6133 5 жыл бұрын
This was a great video, very well structured with good sound and visuals.
@miar190691
@miar190691 3 жыл бұрын
awesome tutorial. I just made a few modification to add user input. thank you master :)
@789sunshine
@789sunshine 3 жыл бұрын
Thanks a ton! Just exactly what I was looking for!
@SupermotoZach
@SupermotoZach 8 ай бұрын
Who else loves how awesome python is 😀
@FavianTubeX
@FavianTubeX 5 жыл бұрын
why doesn't it display the select results with just the select statement on line 15 (10:00 minutes into video).. why does the code need a fetchall statement instead of just executing the select statement like a normal sql query? not clear on why fetchall is needed even though there's already a select statement above.
@SZOKE19940321
@SZOKE19940321 5 жыл бұрын
all DB stuff I need for a simple app in one video, cool stuff
@KandMe1
@KandMe1 4 жыл бұрын
This is really good. Just to say well done really enjoyed watching this.
SQLite Introduction - Beginners Guide to SQL and Databases
21:49
Caleb Curry
Рет қаралды 62 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
SQLAlchemy Makes Using Python Databases EASY
19:08
Eric Roby
Рет қаралды 9 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 495 М.
SQLite Backend for Beginners - Create Quick Databases with Python and SQL
13:32
SQLAlchemy Turns Python Objects Into Database Entries
22:23
NeuralNine
Рет қаралды 190 М.
Modern Python logging
21:32
mCoding
Рет қаралды 219 М.
Python Tutorial: Context Managers - Efficiently Managing Resources
20:37
SQLModel: The Python Library You Didn’t Know You Needed
14:57
Python in Excel vs. VBA - What You Should Learn in 2024!
10:05
David Langer
Рет қаралды 81 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН