Created
April 30, 2015 21:49
-
-
Save mkolb/7dccad7454e86f8e5987 to your computer and use it in GitHub Desktop.
All moodle courses, ordered by enrollment size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT course.fullname AS course, COUNT(course.id) AS students FROM mdl_role_assignments AS asg | |
JOIN mdl_context AS context ON asg.contextid = context.id AND context.contextlevel = 50 JOIN mdl_user AS u ON u.id = asg.userid JOIN mdl_course AS course ON context.instanceid = course.id WHERE asg.roleid = 5 GROUP BY course.id ORDER BY COUNT(course.id) DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment