Constraints
Learn about constraints in PostgreSQL.
Proper primary keys allow implementation of 1NF. Better normalization forms are achieved when our data model is clean: any information is managed in a single place, which is a single source of truth. Then, our data has to be split into separate tables, and that’s when other constraints are needed.
Foreign key constraint
To ensure that the information still makes sense when found in different tables, we need to be able to reference information and ensure that our reference keeps being valid. That’s implemented with a foreign key constraint.
Get hands-on with 1200+ tech skills courses.