advancedTop 15 Database Design Questions
Design a learning management system (LMS) with courses, enrollments, and progress tracking.
users(id, role CHECK IN ('student','instructor','admin'), email UNIQUE, name) courses(id, title, instructor_id FK, status, price DECIMAL, created_at) lessons(id, course_id FK, title, content, order_position INT, duration_seconds INT, UNIQUE(course_id, order_position)) enrollments(student_id FK, course_id FK, enrolled_at, completed_at NULLABLE, progress_pct DECIMAL(5,2), PRIMARY KEY(student_id, cou
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