Show all students enrolled on all courses
SELECT u.id,u.firstname AS Firstname, u.lastname AS Lastname, crs.fullname AS Course
FROM prefix_course AS crs
JOIN prefix_enrol AS en ON en.courseid = crs.id
JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id
JOIN prefix_user AS u ON u.id = ue.userid
Show what modules are on courses
SELECT DISTINCT crs.shortname, m.name FROM prefix_course AS crs
JOIN prefix_course_modules AS cm ON crs.id=cm.course
JOIN prefix_modules AS m ON cm.module=m.id