Learning Management System Database Schema database schema
The Learning Management System Database Schema database schema is a DB Planner template with 34 tables, 252 columns and 59 relationships, free to use. Core tables include announcements, assignment_submissions, assignments, certificates. It can be opened as an interactive diagram or exported as PostgreSQL, MySQL, or MSSQL DDL.
- Tables
- 34
- Columns
- 252
- Relationships
- 59
- Category
- Education
- Exports
- DBML, SQL, C#
- Price
- Free
What this schema models
A complete learning management system database design covering everything an online course platform actually needs. 34 tables and 13 enums spanning users and scoped roles, a course catalog with modules and lessons, cohorts, enrolment, per-lesson progress tracking, assignments with rubric grading, quizzes with multi-attempt scoring, a weighted gradebook, live sessions with attendance, discussions, announcements and verifiable certificates. THE THREE RULES 1. Progress is tracked per LESSON per ENROLMENT, not per user per course. A learner who takes the same course twice in different cohorts gets two independent progress trails and neither overwrites the other. lesson_progress also stores last_position_seconds, which is what resumes a video where the learner left it. 2. Grades are SNAPSHOTS. gradebook_items freeze max_points and weight_percent per cohort at publish time, so re-weighting an assessment next term cannot silently rewrite last term's transcript. That single decision is the difference between a gradebook you can defend and one you cannot. 3. Attempts are ROWS. A quiz attempt or assignment resubmission is a new row with a higher attempt_number, never an UPDATE over the previous one. That is what makes "best of three" and "show me what they answered the first time" both answerable from the same table. DETAILS WORTH STEALING - The COURSE is the syllabus; the COHORT is a run of it. Dates, capacity and enrolment hang off the cohort, so the same course can run every term without cloning content. Self-paced offerings still get one cohort so every enrolment has a parent. - user_roles carries a nullable course_id. Null is a global role, set is scoped to one course. That one column is the whole per-course instructor model. - Roles are a TABLE, not an enum, so a deployment can add its own without a migration. - Rubric scores are stored per criterion. The assignment grade is their sum, which is what makes marking defensible when a student appeals. - quiz_attempts snapshots max_score, so editing a quiz later cannot distort an old percentage. - grades.published_at null means the instructor can see the mark and the learner cannot — release is a timestamp, not a separate workflow table. - Certificate revocation is a timestamp, never a delete, so an old verification URL still resolves and says revoked. - Discussions with cohort_id null span every run of a course; set, they scope to one cohort. WHAT YOU GET Clean DBML that imports straight into DB Planner, plus a laid-out board with cards colour-coded by zone — identity, catalog, enrolment, assignments, quizzes, gradebook, live sessions and communication — with sticky notes explaining each decision and every table carrying its own Note. Postgres-flavoured types that port cleanly to MySQL or SQL Server. Useful for developers building an LMS or course marketplace, students who need a realistic e-learning ER diagram for a DBMS project, and education teams evaluating a data model before committing to Moodle, Canvas or a custom build.
Tables (34)
| Table | Columns |
|---|---|
| announcements | 7 |
| assignment_submissions | 8 |
| assignments | 10 |
| certificates | 8 |
| cohort_members | 4 |
| cohorts | 9 |
| course_categories | 5 |
| course_instructors | 4 |
| courses | 15 |
| discussion_posts | 9 |
| discussions | 9 |
| enrollments | 9 |
| gradebook_items | 8 |
| grades | 9 |
| lesson_progress | 8 |
| lesson_resources | 7 |
| lessons | 10 |
| live_sessions | 9 |
| modules | 6 |
| notifications | 8 |
| question_options | 5 |
| quiz_answers | 7 |
| quiz_attempts | 9 |
| quiz_questions | 7 |
| quizzes | 10 |
| roles | 4 |
| rubric_criteria | 6 |
| rubric_scores | 7 |
| rubrics | 4 |
| session_attendance | 5 |
| submission_files | 6 |
| user_profiles | 7 |
| user_roles | 4 |
| users | 9 |
Relationships (59)
announcements.author_id references users.idmany to oneannouncements.cohort_id references cohorts.idmany to oneassignment_submissions.assignment_id references assignments.idmany to oneassignment_submissions.enrollment_id references enrollments.idmany to oneassignments.course_id references courses.idmany to oneassignments.module_id references modules.idmany to onecertificates.enrollment_id references enrollments.idmany to onecohort_members.cohort_id references cohorts.idmany to onecohort_members.user_id references users.idmany to onecohorts.course_id references courses.idmany to onecourse_categories.parent_id references course_categories.idmany to onecourse_instructors.course_id references courses.idmany to onecourse_instructors.user_id references users.idmany to onecourses.category_id references course_categories.idmany to onediscussion_posts.author_id references users.idmany to onediscussion_posts.discussion_id references discussions.idmany to onediscussion_posts.parent_post_id references discussion_posts.idmany to onediscussions.cohort_id references cohorts.idmany to onediscussions.course_id references courses.idmany to onediscussions.created_by references users.idmany to onediscussions.lesson_id references lessons.idmany to oneenrollments.cohort_id references cohorts.idmany to oneenrollments.user_id references users.idmany to onegradebook_items.assignment_id references assignments.idmany to onegradebook_items.cohort_id references cohorts.idmany to onegradebook_items.quiz_id references quizzes.idmany to onegrades.enrollment_id references enrollments.idmany to onegrades.gradebook_item_id references gradebook_items.idmany to onegrades.graded_by references users.idmany to onelesson_progress.enrollment_id references enrollments.idmany to onelesson_progress.lesson_id references lessons.idmany to onelesson_resources.lesson_id references lessons.idmany to onelessons.module_id references modules.idmany to onelive_sessions.cohort_id references cohorts.idmany to onelive_sessions.host_id references users.idmany to onemodules.course_id references courses.idmany to onenotifications.course_id references courses.idmany to onenotifications.user_id references users.idmany to onequestion_options.question_id references quiz_questions.idmany to onequiz_answers.attempt_id references quiz_attempts.idmany to onequiz_answers.question_id references quiz_questions.idmany to onequiz_answers.selected_option_id references question_options.idmany to onequiz_attempts.enrollment_id references enrollments.idmany to onequiz_attempts.quiz_id references quizzes.idmany to onequiz_questions.quiz_id references quizzes.idmany to onequizzes.course_id references courses.idmany to onequizzes.module_id references modules.idmany to onerubric_criteria.rubric_id references rubrics.idmany to onerubric_scores.criterion_id references rubric_criteria.idmany to onerubric_scores.scored_by references users.idmany to onerubric_scores.submission_id references assignment_submissions.idmany to onerubrics.assignment_id references assignments.idmany to onesession_attendance.enrollment_id references enrollments.idmany to onesession_attendance.session_id references live_sessions.idmany to onesubmission_files.submission_id references assignment_submissions.idmany to oneuser_roles.course_id references courses.idmany to oneuser_roles.role_id references roles.idmany to oneuser_roles.user_id references users.idmany to oneusers.id references user_profiles.user_idone to one
How to use this template
- Open the diagram to see the tables and how they relate.
- Copy it into your workspace. You get your own editable copy.
- Export it as PostgreSQL, MySQL, or MSSQL DDL, or as C# models.
Frequently asked questions
- What is in the Learning Management System Database Schema schema?
- 34 tables and 59 relationships, across 252 columns. The table names and the full relationship list are shown on this page.
- Can I export it to PostgreSQL or MySQL?
- Yes. Every DB Planner template exports as DBML, PostgreSQL, MySQL, or MSSQL DDL, and as C# models.
- Is this template free?
- Yes. You can open it in the browser without an account, and copy it into your own workspace with a free DB Planner account.
- Can I change it after copying it?
- Yes. A copy is yours: you can rename tables, add columns, and export it. Changes the author makes later do not affect your copy.