How to Execute SQL from a File on SqLite Using Python

preview_player
Показать описание
Let's go back to our look at SqLite, a fantastic, high performance file database that can be embedded with apps and handle all kinds of data operations when no data server is available. Like all RDBMS systems, SqLite can take a SQL file that is full of statements and execute them all. This allows you to build your SQL in your favorite editor, just as you would do for other databases, then run it just by specifying the filename in your script. Join me as we introduce executescript on sqlite3 using Python.

Related Videos:
Getting Started with SQLite for Python
How to Execute SQL from a File on SqLite Using Python
You are watching this video now!
How to Select Data from SQLite
How to Output HTML from SQLite
Migrate Data from MS Excel to SQLite and Back Again
How to Use Dates in SQLite
How to Create a Delimited Field in your SQLite Query with Python
How to Make an Interactive Map Using Python and SQLite Data

Interested in transforming your career or finding your next gig?

Want my team to do a project for you? Let's get to it!

Want to get access to premium content made just for you and have a chat with me? Find me on Patreon :

Want to work with me 1:1? Contact me today and book your free 20 min consultation!

Follow me on social media:

Get Microsoft Office including Access:

Got a YouTube Channel? I use TubeBuddy, it is awesome. Give it a try:

#sqlite #sqlite3 #python
Рекомендации по теме
Комментарии
Автор

Just what I was looking for! Thank you!!

lucatoni
Автор

Hi Sean can you maybe show/make a video of how you read the .sql script in sqlite3, but with a function and then add, remove and update information in your database?

lucillewiid
Автор

Great video. I have a few questions though.
1)Can you import * from the sqlite3 module and if so, isn't that better to do?
2)Why did you import a seperate function from sqlite3 if the whole module was imported in the first place?
3)On line 6, on the filename variable, What does 'r' do exactly? I've noticed that it covers the backslashes but what's the definition of it?

uncleiroh
Автор

Good Video, I have a question too.
How to execute multi SQL statements from a sql file with psycopg2 using python

sandhyas
visit shbcf.ru