advancedTop 15 Database Design Questions
Design a content management system (CMS) supporting versioned documents.
documents(id, slug UNIQUE, title, status, created_by FK, created_at, updated_at) document_versions(id BIGSERIAL, document_id FK, version_number INT, content TEXT, created_by FK, created_at, PRIMARY KEY(id)) UNIQUE(document_id, version_number) — no duplicate versions per document published_versions(document_id FK PRIMARY KEY, version_id FK UNIQUE) — which version is live tags(id, name UNIQUE), docu
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response