How To Put CSV Data Into An SQLite DB With Python

Pubblicato il: 11 settembre 2022
sul canale di: Make That Work
1,116
13

Storing data in flat files can be OK. But for a lot of applications you really need a database.

Python provides a neat little database out of the box called SQLite.

This video goes through a simple script that puts spreadsheet data into one of these SQLite databases.

First, we import our spreadsheet data (in CSV format) using Pandas. From that Pandas data frame we prepare the data ready for injection into our SQL database.

Then, the script establishes a connection to the database (creating it if it doesn't exist), and creates a cursor object. The cursor is the thing that allows us to work with the database (reading, writing and deleting data).

After that, all that remains is to actually inject the data into our database and we are done!

As a final step, we check to see it has worked by using a database browser (DB Browser) to view the contents of our database.

SQLite Python docs: https://docs.python.org/3/library/sql...
SQL cheat sheet: https://www.sqlitetutorial.net/sqlite...
DB Browser for SQLite: https://sqlitebrowser.org/
Article breaking down databases and spreadsheets: https://365datascience.com/tutorials/...


In questa pagina del sito puoi guardare il video online How To Put CSV Data Into An SQLite DB With Python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Make That Work 11 settembre 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,116 volte e gli è piaciuto 13 spettatori. Buona visione!