How are Moodle tables constructed?
There are over 280 tables in a default installation of Moodle (I'm using Moodle 2.2.1 for this article), and I will endeavour to give a summary description of each one.
To make this article a little easier to read, I have removed the mdl_ prefix.
Each record in the mdl_assignment table, represents an instance of an Assignment that a course creator has included in a course.
Here are records of submissions for each assignment.
Moodle has a sophisticated backup environment that makes use of various tables, for logging purposes and other reasons. Once I understand this area better, I will make more notes!
Here there is a record for each Moodle block that includes its name and version number.
This looks like a table that is used by the Community block
This table contains a record for each occurance of a block, including default regions and default weights.
This table seems to show a record for each block that is actually deployed on the front-end, including its actual region and weight.
Don't know, will let you know when I find out!
A simple record that links blogs with contexts.
Here there are descrete records for a blog entry that has been collected from outside of Moodle.
There are a number of tables that presumably support caching in some way.
This is a list of over 300 different Moodle capabilities (eg. Backing up an activity, restoring a course etc...).
When you create a new Chat activity at site level, or inside a course, a new record is enterred in this table.
Each individual message is stored in this table.
For each chat activity, the most current message is kept in this table.
Each member of a chat activity, has a record here.
Each instance of the Choice activity is recorded here.
Here are the configuration settings for each Choice activity.
If you are using the cohort feature, these two tables will store your data.
Each comment is stored in this table.
There are nearly 400 different configuration settings stored in this table.
Each time a configuration for Moodle is modified, the change is logged, showing who, when, old setting and new setting.
Each configuration for a plugin is stored in this table. These configurations don't seem to be logged in the previous table.
Context levels, depth and related instances are kept in this table.
Don't know I'm afraid.
There is an entry in this table for every course that has been created in your Moodle site. There are 33 fields for each entry, including creation date and language.
I think this is used to restrict modules that can be used with a particular course.
Here is a list of all course categories.
When a student finishes a course, a record is enterred here.
The completion process is managed using 4 separate tables.
Not sure what this table is for. It has 4 fields: id, course, userid, display.
Each time a resource, or activity module is instantiated, an entry is maintained in this table.
For each course_module entry, there can be further configurations in 2 more tables.
This table seems to be related to Moodle Hubs. Presumably used if you want to publish a course to a hub?
Each time a visitor requests a new course be considered, the request is logged here.
Courses are made up of multiple topics or sections. Each section has an entry in this table.
Don't know what these tables are used for?
Every time a student enroles on a course, an entry is made in this table.
The enrolement process involves several steps, including payment, refund and change of enrolment status. These processes are stored in 4 separate tables.
Calendar events are stored in this table.
There are 3 more tables that are used to configure/manage calendar events.
When you use external web services, these tables are used to store your configuration settings.
The Feedback activity uses 9 separate tables.
Every time a file is used in Moodle, it is referenced in this table.
Entries in this table are used to describe the current status of Moodle filters.
This is a table with a number of fields, filter, context, name and value. I therefore think that this table is used for storing filter configurations.
Each time a resource folder is created, a new entry will appear here.
Every time a forum is created (note that there is a default one for every course), a record is added in this table.
There are several other tables, that are used in conjunction with forums.
Every time you add a new Glossary activity to a course, a new entry is made in this table.
There are 5 more tables, including the glossary_entries themselves that are used to support the Glossary activity.
grade_*, gradingform_rubric_*, grading_*
There are 20 different tables dedicated to the grading process.
groupings, groupings_groups, groups, groups_members
There are 4 different tables that handle the grouping function that can be used in Moodle courses.
When you create a new IMS Content Package resource, a new entry will appear here.
When you add a label resource to a course, it is added to this table.
For each Lesson activity that you create for any course, a record is enterred into this table.
There are an additional 7 tables, that go to make up the Lesson activity.
The license plugin uses various licences that are stored in this table.
Almost all visitor interactions are logged in this table. This table can get large!
This table configures what should be displayed when looking at logs.
I think this table stores log queries, so that you don't have to keep typing the same query many times?
There are 4 tables that together hold configurations for accessing remote Learning Tools Interoperability (LTI) resources.
Each time a user sends a message to another user, the message is stored here.
There are 5 additional tables that allow further configuration of the Message function.
The MNet configurations are stored in thirteen different tables.
Here is a list of all resource and activity modules.
When a student changes their home page, an entry will appear in this table.
Don't know yet what this table is for!
There are 6 tables that support the Portfolio plugin.
Blogging posts are stored here.
This table stores performance profiling results.
This table stores additional options for essay questions.
There are 25 tables that support all the different types of questions.
There are 11 tables for the quiz activity.
Ratings are used throughout Moodle. When you make a rating, it is stored in this table.
This table is used in conjunction with Community Hubs.
The repository feature of Moodle, uses 3 separate tables.
Each record is a resource with its configuration.
Backup of old resources from Moodle 1.9.
There are 7 tables that come together to manage the Moodle role system.
One entry for each configured Moodle scale.
Logged configurations for the scale feature.
There are 11 SCORM tables.
Details of your visitors session of interaction, are logged here.
There are 6 tables that populate your stats data, if you've enabled statistics for your Moodle site.
The survey activity uses 4 tables.
All tags are stored in this table.
Tags are further configured with 2 more tables.
Over 2,000 timezones are stored in this table.
Not sure about this one. Clearly it's something to do with language, presumably related to Moodle tools?
This table logs the upgrade process.
For each URL resource, there is a record in this table.
Each Moodle user has an entry in this table. Even users who are authenticated externally.
When a user enrols on a course, an entry is made in this table.
Additional information about users is configured with 3 tables.
This table keeps a running list of the last time a user logged on to this Moodle site.
This table stores user preferences.
Access keys that can be used instead of cookies.
Locks for the webdav resource.
There are 7 tables for managing wiki content.
There are 21 tables for managing the Workshop activity.
Thanks for visiting.