Learning Management System Database Schema database schema
The Learning Management System Database Schema database schema by Colton Bristow has 34 tables (users, user_profiles, roles, user_roles and 30 more), 252 columns and 59 relationships, documented column by column.
- Tables
- 34
- Columns
- 252
- Relationships
- 59
- Enums
- 13
Tables (34)
| Table | Columns | Description |
|---|---|---|
| users | 9 | One row per person regardless of role. A user can be a student in one course and an instructor in another. |
| user_profiles | 7 | One-to-one with users. Split out because it is display data, not credentials. |
| roles | 4 | Named permission bundles: student, instructor, teaching_assistant, admin. Roles are data, not an enum, so a deployment can add its own. |
| user_roles | 4 | course_id null is a global role; set, it is scoped to one course. That single nullable column is what makes per-course instructors work. |
| course_categories | 5 | Self-referencing tree. parent_id null is a top-level subject area. |
| courses | 15 | The course is the syllabus, not a run of it. Dates and enrolment live on cohorts, so the same course can run every term. |
| course_instructors | 4 | |
| modules | 6 | Sections, weeks or units. One level of grouping is enough; deeper nesting is where course builders get unusable. |
| lessons | 10 | is_preview marks a lesson viewable without enrolling, which is the whole marketing funnel for a paid course. |
| lesson_resources | 7 | Slides, PDFs, datasets and links. Bytes live in object storage; this holds the pointer. |
| cohorts | 9 | A run of a course. Self-paced offerings still get one cohort so every enrolment has a parent to hang dates and capacity on. |
| cohort_members | 4 | Covers teaching assistants and observers who need cohort access without being enrolled learners. |
| enrollments | 9 | The spine of the learner side. progress_percent is a cache rebuildable from lesson_progress. Everything a learner does points at an enrolment, never at a course. |
| lesson_progress | 8 | Per enrolment, not per user. Re-taking the course in a new cohort starts a clean trail. last_position_seconds is what resumes the video. |
| assignments | 10 | Defined on the course, but due dates are shifted per cohort at delivery time by the application layer. |
| assignment_submissions | 8 | A resubmission is a new row with a higher attempt_number, never an edit. is_late is frozen at submit time against the due date that applied then. |
| submission_files | 6 | |
| rubrics | 4 | At most one rubric per assignment. Its criteria must sum to the assignment max_points. |
| rubric_criteria | 6 | |
| rubric_scores | 7 | Per-criterion scores. The assignment grade is their sum, which is what makes a rubric defensible when a student appeals. |
| quizzes | 10 | |
| quiz_questions | 7 | |
| question_options | 5 | Multiple correct options are allowed, which is how multi-select questions work without a second table. |
| quiz_attempts | 9 | Each attempt is its own row, never an update. max_score is snapshotted so editing the quiz later does not distort an old percentage. |
| quiz_answers | 7 | selected_option_id for choice questions, text_answer for free response. is_correct null means it is awaiting manual marking. |
| gradebook_items | 8 | One column of the gradebook, per cohort. max_points and weight are frozen here so re-weighting next term cannot rewrite last term. |
| grades | 9 | One cell of the gradebook. published_at null means the instructor can still see it but the learner cannot. |
| certificates | 8 | The serial is the public verification handle. Revocation is a timestamp, never a delete, so an old certificate URL still resolves and says revoked. |
| live_sessions | 9 | |
| session_attendance | 5 | minutes_attended is stored rather than derived, because a learner can join and leave several times. |
| discussions | 9 | cohort_id null makes the thread visible to every run of the course; set, it is scoped to one cohort. |
| discussion_posts | 9 | |
| announcements | 7 | published_at null is a draft. Scheduling is the same column set to a future time. |
| notifications | 8 | reference_id is a loose pointer to whatever the notification is about, kept untyped so adding a new notification type needs no migration. |
Enums (13)
- course_level
- beginner, intermediate, advanced, all_levels
- course_status
- draft, published, archived
- lesson_type
- video, article, pdf, slides, external_link, live
- resource_type
- pdf, slides, dataset, code, link, other
- enrollment_status
- active, completed, dropped, expired, suspended
- progress_status
- not_started, in_progress, completed
- submission_status
- draft, submitted, returned, graded, resubmit_requested
- question_type
- single_choice, multiple_choice, true_false, short_answer, essay
- attempt_status
- in_progress, submitted, auto_submitted, graded, abandoned
- attempt_review_policy
- never, after_submission, after_due_date, after_last_attempt
- grade_status
- pending, graded, excused, missing
- session_status
- scheduled, live, ended, cancelled
- notification_type
- enrolment, announcement, assignment_due, graded, discussion_reply, session_reminder, certificate_issued
Document your own schema
This page is published from DB Planner, a collaborative ER diagram tool. Write the schema in the DBML editor or import it from SQL, then publish docs like these from the project's sharing settings.