Learn to design well-structured PostgreSQL tables: pick the right data type for every column, model relationships correctly, and enforce data quality with keys and constraints. You will finish able to translate a real-world requirement into a clean, normalised schema that keeps bad data out.
Watch the free preview
Numeric and boolean types — free to watch, no account needed.
What you'll learn
- Design well-structured tables that model a real domain accurately
- Choose the correct PostgreSQL data type for numeric, text, boolean, date/time and UUID columns
- Enforce data quality with NOT NULL, UNIQUE, CHECK and DEFAULT constraints
- Model relationships with primary and foreign keys and apply normalisation basics
- Evolve an existing schema safely with ALTER TABLE
Syllabus
Choosing the Right Data Types
Numeric and boolean typesFree preview
Text, date/time and UUID types
Creating Tables and Keys
CREATE TABLE and primary keys
NOT NULL, DEFAULT, UNIQUE and CHECK constraints
Relationships and Normalisation
Foreign keys and referential integrity
Normalisation basics
Evolving a Schema
Changing tables safely with ALTER TABLE
Putting it together — designing a schema from requirements
Lab — 10 Exercises & Solutions
Exercises 1–5
Exercises 6–10