LMSouq
database Open

Sql query to display all user with enroll course

AA
Aaron Tan
1 month ago
3 views
Problem Description
In the query below, it is currently displaying user that is enrolled in courses. I would like the query to show non enrolled user also. SELECT user.firstname AS Firstname, user.lastname AS Lastname, user.email AS Email, course.fullname AS Course FROM mdl_course AS course JOIN mdl_enrol AS en ON en.courseid = course.id JOIN mdl_user_enrolments AS ue ON ue.enrolid = en.id JOIN mdl_user AS user ON ue.userid = user.id

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base