O comando a seguir mostra as instâncias de recursos e atividades criadas em todos os cursos do Moodle.
SELECT cm.id,m.name AS modulename,cm.idnumber,cm.added,cm.completion,cm.added AS timecreated,cm.section,s.name AS sectionname,c.fullname AS coursename FROM mdl_course_modules cm INNER JOIN mdl_modules m ON m.id=cm.module INNER JOIN mdl_course c ON c.id=cm.course INNER JOIN mdl_course_sections s ON s.id=cm.section WHERE cm.visibleold=1 AND cm.deletioninprogress=0