Skip to content
mentoor

Data modeling

For engineers

Designing schemas with keys and constraints, normalizing on purpose, and changing schemas safely with migrations an agent may write

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

What turns a column named customer_id into an enforced relationship?

Choose one answer

Check yourself · 2 of 5

A table stores customer_email on every order row. What problem does this create?

Choose one answer

Check yourself · 3 of 5

What is the first step when replacing a column that the running app reads?

Choose one answer

Check yourself · 4 of 5

A generated table has a column role_ids text holding values like '1,4,9'. What is the fix?

Choose one answer

Check yourself · 5 of 5

In a shared table for many customers, which UNIQUE constraint fits a contact's email?

Choose one answer

Topics

  1. Designing tables from a domain5 min read · Turning entities and relationships into tables with primary keys, foreign keys, NOT NULL, CHECK and unique constraints that make bad rows impossible
  2. Normalizing and deliberate denormalization5 min read · Normal forms in plain terms, update anomalies, and copying data for read speed only with a rule that keeps the copies in sync
  3. Zero-downtime schema migrations6 min read · Expand and contract steps, batched backfills, adding columns and indexes without long locks, and migrations that can be rolled back
  4. Schema anti-patterns in generated models5 min read · Entity-attribute-value tables, comma lists in one column, money stored as floats, missing foreign keys and timestamps without time zones in AI scaffolds
  5. Modeling tenants, history and soft deletes6 min read · Tenant ids on every row, row-level security, audit and history tables, and soft-delete flags that every query must remember

Start here

Helps to know first

110 questions · last verified 2026-12