Design a database schema for a blog with posts, authors, and tags
Tests normalization and many-to-many design. A strong answer covers a users table with role enum, a posts table referencing user_id, and a post_tags join table for categories. Red flag: storing tags as a comma-separated string in the posts table.
Tests normalization and many-to-many modeling in relational databases. A strong answer covers a users table with user_id primary key, unique email, hashed password, role enum, and timestamps; a posts table referencing users.user_id as author; a categories table; and a post_tags join table linking posts to tags. Also mention supporting tables like comments and post_views for engagement tracking. Red flag: comma-separated tag strings in the posts table, which breaks first normal form and prevents indexing.
Read the original → dragonflydb.io
- #database schema
- #relational design
- #normalization
- #many-to-many
- #content modeling
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.