SQLite in Python || Python Tutorial || Learn Python Programming
Vložit
- čas přidán 11. 04. 2023
- Are you a Python programmer who loves Data? This is your lucky video! Hit play as we dive into the world of SQLite in Python. We'll cover connecting & creating databases, cursors, different ways to execute queries, the secrets of dodging SQL Injection Attacks, and more! So buckle up, grab your coding gear, and let's get this party started!
Find our programming playlists here:
Python: bit.ly/PythonSocratica
SQL: bit.ly/SQL_Socratica
Subscribe to Socratica + bell for notifications:
bit.ly/SocraticaSubscribe
⧓⧓⧓⧓⧓
We recommend:
How to Be a Great Student
ebook: amzn.to/2Lh3XSP
Paperback: amzn.to/3t5jeH3
Kindle Unlimited (read free): amzn.to/3atr8TJ
Python Cookbook, 3rd edition
amzn.to/3jprjX2
⧓⧓⧓⧓⧓
Join this channel to get access to perks:
/ @socratica
Support Socratica on Patreon:
/ socratica
Python instructor: Ulka Simone Mohanty (@ulkam on Twitter)
Written & Produced by Michael Harrison
Edited by Megi Shuke and Michael Harrison
#pythontutorial #sqlite #coding
This is a great introduction to the use of for SQLite and Python. As always, the deadpan humor is much appreciated. 💜
I can not convey how much I am glad to see your videos coming back.
I use SQLite extensively with C#. But I am glad to see that I can extend my usage to python as well.
Please, please, please, make more videos like this, and with more frequency 🙏🙏
I started learning SQL yesterday, and am using it in Python. This video has arrived with precise timing. Would expect nothing less from Socratica. Thank you for making this video!
SYNCHRONICITY!! 💜🦉
This could not have come at a better time...my boss just asked me to speed up our dashboards and start managing our own data instead of relying on the technology team. Awesome video as always.
I love the way this is narrated SO much. It's the perfect amount of efficient, to-the-point teaching and humour. It keeps me engaged and interesting through otherwise relatively dry subject matter
{
"title":"SQLite in Python",
"chapters":{
"start" : "00:00:00",
"What is SQLite" : "00:00:34",
"Create DB" : "00:01:20",
"Create Table" : "00:02:27",
"Insert data" : "00:03:13",
"Commit the connection" : "00:04:42",
"Data Types" : "00:05:07",
"execute & exececutemany" : "00:05:50",
"executescript" : "00:06:01",
"Cursor iteration" : "00:07:12",
"? placeholder" : "00:07:39",
"Summary" : "00:08:42",
"end" : "00:10:10"
}
}
"timestamps.json"
pinTheComment()
pinTheComment()
This channel just keeps getting better! Cheers!
I don't remember enjoying a cs related education video this much, absolutely loved it! Thank you.
Oh how much I love these videos :D ... Amazing style and so entertaining!
𝙎𝙩𝙖𝙮 𝙞𝙣 𝙩𝙝𝙚 𝙡𝙤𝙤𝙥 𝙄𝙉𝙁𝙄𝙉𝙄𝙏𝙀𝙇𝙔: snu.socratica.com/python
Code samples & test data live at → github.com/socratica/python
This is wonderful, the comedic take is sublime.
I LOVE that style, learning is a breeze here!
Appreciate you have included the topic of SQL injection in this short video.
I'm new to Python and SQL and this helped me overcome my first hurdle - also made me giggle too, which is very much a plus - Great stuff!!
Love the video style, production and clear content, thank you!
Great, great, great to see and hear you back ! Thank you ! So cool that you have immediately involved ChatGPT (who haven't ?). Eager to see more and more of your brilliant videos !
Welcome back Socratica. Please continue posting videos.
I would really love a MongoDb video just like this. 🙏🏽
Have you tried duckdb?
@@murphygreen8484 I have not 😞 . Thanks for the recommendation it looks interesting. 😄
Omg! ❤ it's been so long. I'm just happy to have a new SQL video on socratica
We're so tickled we had a chance to make another programming video! Working on the next script now...
Welcome Back, OMG
I watched just to enjoy your amazing hilarious presentation. :D
Aslo, as alwase the best content ever.
Another fine video full of memorable info. Thanks!
these videos are always so clear and funny.
Yes lol exactly
SQLite standing behind you: Am I a joke to you?!
Wow, thank you. I love your tutotials.
This is pure gold! loved the humor
I've been using SQLite3 for years in python to import and export Excel files. I love the versatility. It makes anything I can put into Excel, easy to handle for generating formatted colorized output in a terminal of a bastion server. Also love the fact that I still learned a couple new concepts from this video. Great job.
hi there do i have to download sqlite3 to connect? i'm getting an error.
@@user-yo9om1zr3l you should be able to use sqlite in python, but if you want to interact with the program outside of python you may need to download some more materials.
Thank you, and welcome back :)
I need to write a Python script that detects I am watching your videos, and then reminds me to NOT be drinking or chewing while watching, or I may be cleaning up my desktop yet again. LOVE the humor!
I come to these videos for the bone-dry humor in addition to the education. Another winner!
i love how you explain these things
You are back!
The Snap at the end... LOL🤣
It got me too 😅😅😅😅😅😅😅🤣
Sensational. Thanks.
Great Video!
As always good explained😊
Welcome back!
Well done!
Great stuff
Wonderful💙
Hey there
It's been a while .. u are my hero
Only Socratica can make me watch a tutorial on Friday night!
She's back.
Very Interesting Video ⭐⭐⭐⭐⭐😊
BIG like for your BIG video.
Ulka I'm obsessed with you and your abilities.
I wish you come to India then 🍽️ be from my side.
Please bring your Socratica fnds too 😅
Been using your tutorial since school, now I'm a graduate in computer science. How time flies. 😅 Waiting for a new tutorial to be dropped back then.
We're so happy to be making this journey with you! 💜🦉
I enjoy this character, I would watch even if I wasn't interested in the subject.
I love how she specifies "In another timeline" for the SQL intro lol. So the SQL series is another timeline in the SCU - Socratica Cinematic Universe. Very small touch but I love it 😂
Thank youuuuuu
Can you close the connection with a context manager?
I wonder if sqlite has constraint support. To enforce relational rules between tables
Thanks, please talk about mongodb and python too
I would recommend using the with statement, it does the closing for you.
Question can I do:
with sqlite3.connect("mydb") as mycon, mycon.cursor() as curs:
#do something
or does it need to be
with sqlite3.connect("mydb") as mycon:
with mycon.cursor() as curs:
#dosomething
Update maybe you need to use the context liberary for that.
Example usage of context manager, simply use it on the connection.
import sqlite3
def execute_query(query, db_name, parameters= ()):
with sqlite3.connect(db_name) as conn:
cursor = conn.cursor()
query_result = cursor.execute(query, parameters)
conn.commit()
return query_result
if __name__ == "__main__":
db_name = "member.db"
query = "SELECT * FROM table"
results = execute_query(db_name=db_name, query=query)
for result in results:
print(result)
Hey Socratica...Please put Ulka's name in the credits... She does a fantastic job... Thanks!
Ulka's the BEST! You can find the Socratica Team credits in the Description. Thanks for your nice message. 💜🦉
I Love your videos
It would be awesome if Socratica did NodeJS and Golang.
Thanks!
Thank you so much, kind Socratica Friend!
@@Socratica votary
8:38 = cur.execute("SELECT * FROM membros WHERE fn=?", (user_input,))
Thank you! executescript is new for me...
I'm now convinced that ChatGPT is a subconscious copy of Socratica
Refresh with a video on DuckDB?
Now you're speaking my language.
That was the most weird and understandable tutorial I've seen in a while
Weird and Understandable is us exactly thank youuuu 💜🦉
1:32 please share how to start from a csv data?! thanks :)
JS is respectable....FINALLY! Wheeee!
6:09 Flashbang harder than Filian
You got me for a moment, but I checked. I'm alone in the room...
2:04 "If you try to connect to a database file that does not exist, then one will be created for you. So if you misspell the name of an existing database, surprise - you now have a second database."
This example shows that evolution in programming languages apparently does not imply better quality and sophistication. More than 50 years ago some languages would automatically inform you of een error which, depending on the errorcode could be processed and taken appropriate action on the fly under program control.
You wrap it around "if os.path.exists(filename) " . There will always be a default action for every command. You must think of every common use case.
❤❤
We need how to use chatgpt in terminal
how are you making this voice?
Love from Pakistan ❤
Surprise! You now have a second database...😂😂
Fun Fact: sqlite uses flexible typing, and datatype names in column definitions are completely optional 😳
hei ! I subscribed in a Group Theory Channel what happened ?
A robot? :)
I need to overcome the anxiety that I don't have graphical interface if using sqlite
it’s not always the size of data that matters, but how you use it…
whoa js is respectable now!? how about that!
She's back to the channel or it's just AI generated video? Or she's been an AI all along? I don't follow this community much so I was curious
It's AI...you can see the pixels
@@thatotherguy4245 🤣🤣🤣
Everywhere I go I overload SQLite Databases 😢
everything is big now 🤣
Did You really name yout son Robert'); DROP TABLE Students;-- ?
Fr Fr Fr 🎯🎯🎯💯
Whopping zero bytes🤣
Why is this video talking like a robot?
Implying Java is not a respectable programming language haha.
Not even C++ got a taste of respect haha
Java is a great language.
Java has been dead for 10+ years and yes microsunsystems and their autistic kiddie language is terrible
ridiculous
I wish you wouldn't use ChatGPT.
She has been teaching Python and sql well before ChatGPT ever existed
I wish people wouldn't just think people are using ChatGPT
We definitely want to help people understand how to use this new remarkable tool. We can't ignore that it exists! 💜🦉
Thanks!
Thank you for your kind support!!