From the course: Hands-On Analytics Engineering Project
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Loading data into a database
From the course: Hands-On Analytics Engineering Project
Loading data into a database
- [Instructor] Now that our data is cleaned and formatted, we can push it back into our database. This will facilitate our analysis in SQL. We could perform a similar analysis here in Python, but I'd love for you to get familiar with both tools, so we'll switch over to SQL next. To push our data to our database, we need to enable the SQLite tool here in our code space. You don't need to install anything on your computer, just in this browser environment. In the left hand navigation, go to extension. Then in the top search bar, type SQLite. You should now see a prompt to install SQLite and SQLite Viewer. Go ahead and select them. This will allow you to edit and execute .SQL files in the next chapter. Let's return back to our Python script. In order to push our clean data to the database, we need to import the SQLite library in our Python script. In a new cell type import SQLite3. Now we need to establish a connection to the database we have in our files. It's called database.DB. To…