MISSION 248

Loading and Extracting Data With Tables

In the previous lessons of this Postgres course, we've been exploring PostgreSQL, and we have been mostly concerned with the different datatypes and their impact on performance when querying tables. 

In this mission, you will evaluate the performance of loading data as well as extracting data to and from Postgres tables. Specifically, you will learn how to insert multiple values in a table at once as well as how to copy a Postgres table into a file. You will also learn more about the `cursor.execute` method and how it converts Python types into Postgres types.

While learning how to loading data with Postgres tables, you will continue to work on the IGN reviews dataset that contains reviews from games.

Knowing how to load and extract data tables with tables in Postgres is an important skill for anyone with an interest in data engineering, and as you learn you’ll be applying each new skill in our browser-based coding environment to ensure you can implement everything you’re learning.

Objectives

  • Learn the process of loading data into Postgres tables
  • Learn how to extract Postgres data and clean it

Mission Outline

1. The Mogrify Method
2. The Connection Encoding
3. Inserting with Mogrify
4. Postgres Copy Method
5. The COPY statement
6. Which method is faster?
7. Extracting Table to CSV File
8. Making a Copy of a Table
9. Copy with Insert and Select
10. Next steps
11. Takeaways

postgres-for-data-engineers

Course Info:

Intermediate

The median completion time for this course is 5.2 hours. View Details

This course requires a premium subscription. This course includes five missions, one installation tutorial and one guided project.  It is the first course in the Data Engineer path.

START LEARNING FREE

Take a Look Inside