From the course: End-to-End SQL Database Design and Optimization Project
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Loading data - SQL Tutorial
From the course: End-to-End SQL Database Design and Optimization Project
Loading data
- [Narrator] In the previous video, we transformed the extracted data by cleaning, standardizing, and preparing it for insertion into our database. In this final phase, we load the transform data into the MySQL database. But before loading, we clear the existing data from the relevant tables to ensure there are no conflicts or duplicates. Now, if you recall, when we created our tables, we did load some sample records. Now this is the data that we are going to be clearing out in this step. Let's now step through the Python code here and understand it a little bit more. In our first step, as we mentioned, we're clearing out any existing data. Now, before inserting new data, we delete all records from the target tables, and those are the payments, reviews, orders, users, and products tables. And this is to avoid any conflicts, and ensure we are working with fresh data. This is a piece of code that does this for us. This deletes any records that exist in our tables, which we've listed out…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.