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.

ER diagram of the Learning Management System Database Schema schema, showing 34 tables and their relationships
FIG. 1: entity relationship diagram, 34 tables
Tables
34
Columns
252
Relationships
59
Enums
13

Tables (34)

Tables in the Learning Management System Database Schema schema
TableColumnsDescription
users9One row per person regardless of role. A user can be a student in one course and an instructor in another.
user_profiles7One-to-one with users. Split out because it is display data, not credentials.
roles4Named permission bundles: student, instructor, teaching_assistant, admin. Roles are data, not an enum, so a deployment can add its own.
user_roles4course_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_categories5Self-referencing tree. parent_id null is a top-level subject area.
courses15The course is the syllabus, not a run of it. Dates and enrolment live on cohorts, so the same course can run every term.
course_instructors4
modules6Sections, weeks or units. One level of grouping is enough; deeper nesting is where course builders get unusable.
lessons10is_preview marks a lesson viewable without enrolling, which is the whole marketing funnel for a paid course.
lesson_resources7Slides, PDFs, datasets and links. Bytes live in object storage; this holds the pointer.
cohorts9A run of a course. Self-paced offerings still get one cohort so every enrolment has a parent to hang dates and capacity on.
cohort_members4Covers teaching assistants and observers who need cohort access without being enrolled learners.
enrollments9The 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_progress8Per enrolment, not per user. Re-taking the course in a new cohort starts a clean trail. last_position_seconds is what resumes the video.
assignments10Defined on the course, but due dates are shifted per cohort at delivery time by the application layer.
assignment_submissions8A 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_files6
rubrics4At most one rubric per assignment. Its criteria must sum to the assignment max_points.
rubric_criteria6
rubric_scores7Per-criterion scores. The assignment grade is their sum, which is what makes a rubric defensible when a student appeals.
quizzes10
quiz_questions7
question_options5Multiple correct options are allowed, which is how multi-select questions work without a second table.
quiz_attempts9Each attempt is its own row, never an update. max_score is snapshotted so editing the quiz later does not distort an old percentage.
quiz_answers7selected_option_id for choice questions, text_answer for free response. is_correct null means it is awaiting manual marking.
gradebook_items8One column of the gradebook, per cohort. max_points and weight are frozen here so re-weighting next term cannot rewrite last term.
grades9One cell of the gradebook. published_at null means the instructor can still see it but the learner cannot.
certificates8The serial is the public verification handle. Revocation is a timestamp, never a delete, so an old certificate URL still resolves and says revoked.
live_sessions9
session_attendance5minutes_attended is stored rather than derived, because a learner can join and leave several times.
discussions9cohort_id null makes the thread visible to every run of the course; set, it is scoped to one cohort.
discussion_posts9
announcements7published_at null is a draft. Scheduling is the same column set to a future time.
notifications8reference_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.

More published database schemas