The second of the three Python programs shows how to work with SQLite to import a second dataset into a second table alongside the first table.
- [Instructor] The second step in this DB Clinic challenge…is to import the vehicles 2015 dataset…Again, I could do this by hand…using the SQLite command line interface,…but it will be easier to write a Python script.…Here's how it works.…First go to Python idle, click on file,…open, and we're going to open…the second Python script.…
Again, I'm going to run the script,…I'll show you the changes that happen,…and then we'll come back and examine how the script works.…So I'm going to go up to Python, run,…run module, and the cursor returns…informing us that the script has executed successfully.…Let's go back to DB browser and take a look at the change.…You'll need to refresh…and you can do that by clicking on this icon…that refreshes the data in the selected tables…as well as the file itself.…
Now you can see that we have two tables.…The original table was called accidents,…the new table is called vehicles,…and if we click on that we can browse the vehicles data.…We can come over to the schema window…and look at the structure of the vehicles table.…
- Strengths and weaknesses of SQLite
- Creating a database
- Joining data sets
- Calculations with SQLite and Python
- Searching a database
- Subqueries and queries in SQLite
- CRUD operations in SQLite with R
Skill Level Intermediate
1. SQLite in Five Minutes
2. Create a Database
3. Join Two Datasets
4. Search a Database
5. Create, Read, Update, and Delete Operations
6. Averages and Calculations
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.