Now that you can query and change data, it's time to decide how that data should be stored. Every column in a PostgreSQL table has a data type, and choosing the right one keeps your data accurate, compact, and easy to work with.
You'll explore the main families of types, including numbers, text, dates and times, and booleans, then learn how to build tables with CREATE TABLE. You'll define primary keys and foreign keys to link tables together, and see how normalization helps you organise data without duplication.
With well-designed tables in place, you'll be ready for the next module, Joins, CTEs & Window Functions, where you combine data from several tables and write more advanced queries.
An overview of the main PostgreSQL data types, from text and numbers to booleans and dates, and what each one is best used for.
A step-by-step tutorial on defining and using data types in your own tables. Follow along in your PostgreSQL setup and try each example.
Learn how to create a table with a foreign key, link it to a primary key in another table, and keep related data consistent.
An easy-to-follow tutorial on normalization with plenty of examples. It explains why and how to split data into well-structured tables that avoid duplication.