<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lastent</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lastent"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Lastent"/>
	<updated>2026-06-12T11:10:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Database_schema_introduction&amp;diff=7394</id>
		<title>Database schema introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Database_schema_introduction&amp;diff=7394"/>
		<updated>2008-07-21T14:39:58Z</updated>

		<summary type="html">&lt;p&gt;Lastent: Undo revision 40152 by Lastent (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Moodle database has around 200 tables, and can be quite daunting at first sight. The good news is that you don&#039;t have to understand it all at once. For example, there are eight tables called forum_&#039;&#039;somthing&#039;&#039;. If you are interested in the forum module, then obviously you need to understand these tables, and the places they link into core tables. But if you are not interested in the forum module, you can forget about them. The same is true of each activity module.&lt;br /&gt;
&lt;br /&gt;
Once you take out the tables for each activity module in this way, and similarly take out the tables belonging to the enrolment plugins, question types, etc. You are left with about 50 core tables. But the good news is that even here they break down into groups that mostly you can understand together, or ignore. This page lists the core database tables in these groups. Later, it would be good to add more detailed documentation explaining some of these groups.&lt;br /&gt;
&lt;br /&gt;
The database structure is defined, edited and upgraded using the [[XMLDB_Documentation|XMLDB]] system.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
;config&lt;br /&gt;
;config_plugins&lt;br /&gt;
&lt;br /&gt;
==Users and their profiles==&lt;br /&gt;
&lt;br /&gt;
;user&lt;br /&gt;
;user_info_category&lt;br /&gt;
;user_info_field&lt;br /&gt;
;user_info_data&lt;br /&gt;
;user_lastaccess : this is separated from the user table for performance reasons&lt;br /&gt;
;user_preferences&lt;br /&gt;
;user_private_key&lt;br /&gt;
&lt;br /&gt;
==[[Roles|The roles and capabilites system]]==&lt;br /&gt;
&lt;br /&gt;
;role &lt;br /&gt;
;capabilites&lt;br /&gt;
;context&lt;br /&gt;
;role_allow_assign&lt;br /&gt;
;role_allow_override&lt;br /&gt;
;role_assignments&lt;br /&gt;
;role_capabilities&lt;br /&gt;
;role_names&lt;br /&gt;
;role_sortorder&lt;br /&gt;
&lt;br /&gt;
==Courses and their organisation into categories==&lt;br /&gt;
&lt;br /&gt;
;course&lt;br /&gt;
;course_categories&lt;br /&gt;
;course_display&lt;br /&gt;
;course_meta&lt;br /&gt;
;course_request&lt;br /&gt;
&lt;br /&gt;
==Activities and their arrangement within courses==&lt;br /&gt;
&lt;br /&gt;
;modules&lt;br /&gt;
;course_allowed_modules&lt;br /&gt;
;course_modules&lt;br /&gt;
;course_sections&lt;br /&gt;
&lt;br /&gt;
See also the tables belonging to particular activity modules. For example forum_*, [[Quiz_database_structure|quiz_*]], etc.&lt;br /&gt;
&lt;br /&gt;
==[[Groups|Groups and groupings]]==&lt;br /&gt;
&lt;br /&gt;
;groups&lt;br /&gt;
;groups_members&lt;br /&gt;
;groupings&lt;br /&gt;
;groupings_groups&lt;br /&gt;
&lt;br /&gt;
==The logging system==&lt;br /&gt;
&lt;br /&gt;
;log&lt;br /&gt;
;log_display&lt;br /&gt;
&lt;br /&gt;
==[[Blocks#Creating_Database_Tables_for_Blocks|Blocks system]]==&lt;br /&gt;
&lt;br /&gt;
;block&lt;br /&gt;
;block_instance&lt;br /&gt;
;block_pinned&lt;br /&gt;
&lt;br /&gt;
Some particular blocks also have their own database tables. For example block_rss_client.&lt;br /&gt;
&lt;br /&gt;
==[[Events|Events]]==&lt;br /&gt;
&lt;br /&gt;
;event_*&lt;br /&gt;
&lt;br /&gt;
==Backup and restore==&lt;br /&gt;
&lt;br /&gt;
;backup_config&lt;br /&gt;
;backup_courses&lt;br /&gt;
;backup_files&lt;br /&gt;
;backup_ids&lt;br /&gt;
;backup_log&lt;br /&gt;
&lt;br /&gt;
==Statistics==&lt;br /&gt;
&lt;br /&gt;
;stats_daily&lt;br /&gt;
;stats_monthly&lt;br /&gt;
;stats_user_daily&lt;br /&gt;
;stats_user_monthly&lt;br /&gt;
;stats_user_weekly&lt;br /&gt;
;stats_weekly&lt;br /&gt;
&lt;br /&gt;
==Tags==&lt;br /&gt;
&lt;br /&gt;
;tag_*&lt;br /&gt;
&lt;br /&gt;
==[[Grades|Gradebook]]==&lt;br /&gt;
&lt;br /&gt;
;grade_*&lt;br /&gt;
&lt;br /&gt;
==[[Quiz_database_structure|Question bank]]==&lt;br /&gt;
&lt;br /&gt;
;question&lt;br /&gt;
;question_answers&lt;br /&gt;
;question_attempts&lt;br /&gt;
;question_categories&lt;br /&gt;
;question_sessions&lt;br /&gt;
;question_states&lt;br /&gt;
&lt;br /&gt;
See also the tables for individual question types, which all start question_.&lt;br /&gt;
&lt;br /&gt;
==Messaging system==&lt;br /&gt;
&lt;br /&gt;
;message_*&lt;br /&gt;
&lt;br /&gt;
==[[Moodle_Network|Moodle Network]]==&lt;br /&gt;
&lt;br /&gt;
;mnet_*&lt;br /&gt;
&lt;br /&gt;
==Caching==&lt;br /&gt;
&lt;br /&gt;
;cache_*&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
&lt;br /&gt;
;scale&lt;br /&gt;
;scale_history&lt;br /&gt;
;sessions2&lt;br /&gt;
;timezone&lt;br /&gt;
;post&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Database_Schema]] - some automatically generated diagrams.&lt;br /&gt;
* [[XMLDB_Documentation]] - the XMLDB system used to define, edit, and update the database structure.&lt;br /&gt;
[[Category:XMLDB]]&lt;/div&gt;</summary>
		<author><name>Lastent</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Database_schema_introduction&amp;diff=7393</id>
		<title>Database schema introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Database_schema_introduction&amp;diff=7393"/>
		<updated>2008-07-21T14:38:53Z</updated>

		<summary type="html">&lt;p&gt;Lastent: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Moodle database has around 200 tables, and can be quite daunting at first sight. The good news is that you don&#039;t have to understand it all at once. For example, there are eight tables called forum_&#039;&#039;somthing&#039;&#039;. If you are interested in the forum module, then obviously you need to understand these tables, and the places they link into core tables. But if you are not interested in the forum module, you can forget about them. The same is true of each activity module.&lt;br /&gt;
&lt;br /&gt;
Once you take out the tables for each activity module in this way, and similarly take out the tables belonging to the enrolment plugins, question types, etc. You are left with about 50 core tables. But the good news is that even here they break down into groups that mostly you can understand together, or ignore. This page lists the core database tables in these groups. Later, it would be good to add more detailed documentation explaining some of these groups.&lt;br /&gt;
&lt;br /&gt;
The database structure is defined, edited and upgraded using the [[XMLDB_Documentation|XMLDB]] system.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===config===&lt;br /&gt;
  On this table there is stored data about the main configuration of the moodle installation, their fields are:&lt;br /&gt;
    - id&lt;br /&gt;
    - name&lt;br /&gt;
    - value&lt;br /&gt;
===config_plugins===&lt;br /&gt;
  On this table there is stored data about the plugins that have been installed on our moodle installation, their fields are:&lt;br /&gt;
    - id&lt;br /&gt;
    - plugin&lt;br /&gt;
    - name&lt;br /&gt;
    - value&lt;br /&gt;
&lt;br /&gt;
==Users and their profiles==&lt;br /&gt;
&lt;br /&gt;
;user&lt;br /&gt;
;user_info_category&lt;br /&gt;
;user_info_field&lt;br /&gt;
;user_info_data&lt;br /&gt;
;user_lastaccess : this is separated from the user table for performance reasons&lt;br /&gt;
;user_preferences&lt;br /&gt;
;user_private_key&lt;br /&gt;
&lt;br /&gt;
==[[Roles|The roles and capabilites system]]==&lt;br /&gt;
&lt;br /&gt;
;role &lt;br /&gt;
;capabilites&lt;br /&gt;
;context&lt;br /&gt;
;role_allow_assign&lt;br /&gt;
;role_allow_override&lt;br /&gt;
;role_assignments&lt;br /&gt;
;role_capabilities&lt;br /&gt;
;role_names&lt;br /&gt;
;role_sortorder&lt;br /&gt;
&lt;br /&gt;
==Courses and their organisation into categories==&lt;br /&gt;
&lt;br /&gt;
;course&lt;br /&gt;
;course_categories&lt;br /&gt;
;course_display&lt;br /&gt;
;course_meta&lt;br /&gt;
;course_request&lt;br /&gt;
&lt;br /&gt;
==Activities and their arrangement within courses==&lt;br /&gt;
&lt;br /&gt;
;modules&lt;br /&gt;
;course_allowed_modules&lt;br /&gt;
;course_modules&lt;br /&gt;
;course_sections&lt;br /&gt;
&lt;br /&gt;
See also the tables belonging to particular activity modules. For example forum_*, [[Quiz_database_structure|quiz_*]], etc.&lt;br /&gt;
&lt;br /&gt;
==[[Groups|Groups and groupings]]==&lt;br /&gt;
&lt;br /&gt;
;groups&lt;br /&gt;
;groups_members&lt;br /&gt;
;groupings&lt;br /&gt;
;groupings_groups&lt;br /&gt;
&lt;br /&gt;
==The logging system==&lt;br /&gt;
&lt;br /&gt;
;log&lt;br /&gt;
;log_display&lt;br /&gt;
&lt;br /&gt;
==[[Blocks#Creating_Database_Tables_for_Blocks|Blocks system]]==&lt;br /&gt;
&lt;br /&gt;
;block&lt;br /&gt;
;block_instance&lt;br /&gt;
;block_pinned&lt;br /&gt;
&lt;br /&gt;
Some particular blocks also have their own database tables. For example block_rss_client.&lt;br /&gt;
&lt;br /&gt;
==[[Events|Events]]==&lt;br /&gt;
&lt;br /&gt;
;event_*&lt;br /&gt;
&lt;br /&gt;
==Backup and restore==&lt;br /&gt;
&lt;br /&gt;
;backup_config&lt;br /&gt;
;backup_courses&lt;br /&gt;
;backup_files&lt;br /&gt;
;backup_ids&lt;br /&gt;
;backup_log&lt;br /&gt;
&lt;br /&gt;
==Statistics==&lt;br /&gt;
&lt;br /&gt;
;stats_daily&lt;br /&gt;
;stats_monthly&lt;br /&gt;
;stats_user_daily&lt;br /&gt;
;stats_user_monthly&lt;br /&gt;
;stats_user_weekly&lt;br /&gt;
;stats_weekly&lt;br /&gt;
&lt;br /&gt;
==Tags==&lt;br /&gt;
&lt;br /&gt;
;tag_*&lt;br /&gt;
&lt;br /&gt;
==[[Grades|Gradebook]]==&lt;br /&gt;
&lt;br /&gt;
;grade_*&lt;br /&gt;
&lt;br /&gt;
==[[Quiz_database_structure|Question bank]]==&lt;br /&gt;
&lt;br /&gt;
;question&lt;br /&gt;
;question_answers&lt;br /&gt;
;question_attempts&lt;br /&gt;
;question_categories&lt;br /&gt;
;question_sessions&lt;br /&gt;
;question_states&lt;br /&gt;
&lt;br /&gt;
See also the tables for individual question types, which all start question_.&lt;br /&gt;
&lt;br /&gt;
==Messaging system==&lt;br /&gt;
&lt;br /&gt;
;message_*&lt;br /&gt;
&lt;br /&gt;
==[[Moodle_Network|Moodle Network]]==&lt;br /&gt;
&lt;br /&gt;
;mnet_*&lt;br /&gt;
&lt;br /&gt;
==Caching==&lt;br /&gt;
&lt;br /&gt;
;cache_*&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
&lt;br /&gt;
;scale&lt;br /&gt;
;scale_history&lt;br /&gt;
;sessions2&lt;br /&gt;
;timezone&lt;br /&gt;
;post&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Database_Schema]] - some automatically generated diagrams.&lt;br /&gt;
* [[XMLDB_Documentation]] - the XMLDB system used to define, edit, and update the database structure.&lt;br /&gt;
[[Category:XMLDB]]&lt;/div&gt;</summary>
		<author><name>Lastent</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Database_structure&amp;diff=10229</id>
		<title>Database structure</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Database_structure&amp;diff=10229"/>
		<updated>2008-07-21T03:31:13Z</updated>

		<summary type="html">&lt;p&gt;Lastent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Database Structure]]&lt;br /&gt;
&lt;br /&gt;
On this page we will describe the structure of the database of a Moodle installation&lt;br /&gt;
===Introduction===&lt;br /&gt;
All the data we set on our Moodle installation is stored on a database, the one we set on the installation, Moodle supports many database engines such MySql, Postgresql, etc.&lt;br /&gt;
&lt;br /&gt;
As developers some times we need to know the structure of the tables, what are do they store and what each field mean.&lt;br /&gt;
&lt;br /&gt;
[[Category:Database Structure]]&lt;/div&gt;</summary>
		<author><name>Lastent</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Database_structure&amp;diff=10228</id>
		<title>Database structure</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Database_structure&amp;diff=10228"/>
		<updated>2008-07-21T03:28:23Z</updated>

		<summary type="html">&lt;p&gt;Lastent: New page: Database Structure On this page we will describe the structure of the database of a Moodle installation ===Introduction=== All the data we set on our Moodle installation is...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Database Structure]]&lt;br /&gt;
On this page we will describe the structure of the database of a Moodle installation&lt;br /&gt;
===Introduction===&lt;br /&gt;
All the data we set on our Moodle installation is stored on a database, the one we set on the installation, Moodle supports many database engines such MySql, Postgresql, etc.&lt;br /&gt;
&lt;br /&gt;
As developers some times we need to know the structure of the tables, what are do they store and what each field mean.&lt;br /&gt;
&lt;br /&gt;
[[Category:Database Structure]]&lt;/div&gt;</summary>
		<author><name>Lastent</name></author>
	</entry>
</feed>