Course · 6 lessons ~43 hr Intermediate

Database Design & Modeling

Database Design & Modeling covers: Introduction to Database Systems, Fundamentals of Database Systems, Essential PostgreSQL. Master database design from first principles — normalization theory, entity-relationship modeling, schema design patterns, and the trade-offs between normalized and denormalized designs. Understand why Rails conventions sometimes conflict with good relational design. has_many :through is a join table. Polymorphic associations are a design smell in relational theory — they cannot have foreign key constraints because the _type column determines which table to reference, and PostgreSQL cannot enforce that. STI (Single Table Inheritance) violates 1NF by allowing NULLable columns that are only relevant to specific types. MTI (Multi-Table Inheritance) is relationally cleaner but requires JOINs. Understanding normalization theory helps you make informed decisions about when to use Rails conventions and when to deviate. Database-level constraints (NOT NULL, UNIQUE, CHECK, foreign keys) are stronger than Rails validations because they protect against data corruption from raw SQL, background jobs, and bugs in your code.

reading · we frame, you read MIT or the canonical taught · we author, no canonical fits ↺ spirals back to earlier lessons
Course locked

Complete PostgreSQL Deep Dive first.

This course unlocks once you've finished its prerequisite. Open prerequisite →

6 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.