I am trying to make a report with all the users which attended the face to face sessions for all the system. I did this querry and it returns me some results, but i really don t know if those are the good ones.
This is the querry:
SELECT DISTINCT u.id AS userid, s.id AS submissionid, u.firstname, u.lastname, u.email, f.id AS facetofaceid, f.course AS courseid, gg.finalgrade AS presence, s.sessionid AS idsesiune
FROM mdl_facetoface f
JOIN mdl_facetoface_submissions s ON s.facetoface = f.id
JOIN mdl_user u ON u.id = s.userid
JOIN mdl_grade_grades gg ON gg.userid = s.userid
WHERE s.timecancelled =0
GROUP BY s.sessionid, u.firstname
ORDER BY s.sessionid
Can anyone tell me if it is correct?
How the face to face tables are related to the grade_grades table (one of the fieds is for sure userid, but there are other linked fileds? could itemid be one of them )Thank you in advance!