The Moodle Databasae Schema
This information is generated from the Moodle database schema as contained in the Moodle install.xml files.  A standard Moodle install discards all field comments and foreign key relationships. The SQL for this install was generated using the local_sqlgenerator plugin I created ( which preserves that information. The data from that installation was extracted using  schemaspy (

SQL Generator also adds in around 50 additional foreign key relationships that are implied but not included in the xml install files. I plan to take the orphaned table information from schemaspy to create additional foreign keys.

The grid below is to help identify sections of Moodle functionality. You can go directly to the index of all tables here

I started work on the first versions of this docmentation in early 2004, see this discussion Links to diagrams for older versions of Moodle can be found here

For consultancy and custom development contact Moodle Partners Titus Learning


AssignAssignment analyticsAnalytics BadgeBadges BookBook
ChatChat ChoiceChoice courseCourse DataData
enrolEnrolment FeedbackFeedback ForumForum LessonLesson
LTILTI PagePage QuizQuiz ScormScorm
SurveySurvey usersUsers WorkshopWorkshop WikiWiki