The Moodle 2.2 Database Schema "reverse engineered" from the installed database using
MySQL Workbench For more about Moodle see
For more about the Moodle database structure see
Marcus Green 2015

A Mysql MWB File that can be modified. moodle22.mwb A pdf rendering moodle22_erd.pdf.

How the diagram was created, Diagram FAQ.

Moodle 2.2 ER Diagram