0Pricing
SQL Academy · Lesson

Modelling a Blog: Users Posts Comments

Draw an ER diagram, identify entities and relationships, and translate them into a normalised SQL schema.

The Domain

A simple blog: users write posts, other users comment on posts. Let's turn that into a schema.

Entities

Three core nouns:

  • User — id, email, name
  • Post — id, author, title, body, published timestamp
  • Comment — id, author, post it's on, body

All lessons in this course

  1. Modelling a Blog: Users Posts Comments
  2. Choosing Keys and Types
  3. Indexes for Common Queries
  4. Seeding the Database with Test Data
← Back to SQL Academy