In the previous lesson, you learned some of the basics of PostgreSQL by creating a table for storing user accounts from a CSV file. However, the table that you created used un-optimized datatypes for the type of data you were loading into it.
In this lesson, you are going to learn how to use the proper datatypes when loading our dataset. Correct use of datatypes will save space on the database server, which in turn provides faster reads and writes. Furthermore, having proper datatypes will ensure that any errors in your data will be caught at insertion and your data can be queried in the way you expect.
Additionally, you will discuss the datatypes that Postgres provides and some of their implementation details. Applying these skills as you learn, you will create a table that will fit a dataset with the proper dataypes. After you create the table, you will load in the data and ensure that the data model you selected was appropriate.
Knowing how to use proper datatypes when loading in a dataset is a critical skill for data engineers to learn. As you learn about selecting datatypes and creating tables, you’ll be able to apply what you’re learning directly in your browser window in our interactive coding environment, and get your work checked instantly by our answer-checker.
- Learn how to modify table column data types in Postgres.
- Learn about using proper datatypes for your data.
- Describing a Table
- Adding the id Field
- Finding the Max Length
- Max String-like Datatypes
- Creating the Other String Fields
- Float-like Types
- Boolean Types
- Date Type
- Next steps