June 2017
Beginner to intermediate
368 pages
8h 31m
English
We won't be delving deep into the development of SQL queries in this chapter (there is plenty of good advice freely available on the internet). The following is a basic query that, given a user's email and a time frame, selects a list of courses for which certificates have been issued:
SELECT user.email AS email, course.fullname AS coursename, certissues.timecreated AS timecreated FROM mdl_user AS user INNER JOIN mdl_customcert_issues AS certissues ON user.id = certissues.userid INNER JOIN mdl_customcert AS customcert ON certissues.customcertid = customcert.id INNER JOIN mdl_course AS course ON customcert.course = course.id WHERE user.email = "ian@example.com" AND certissues.timecreated>=0 AND certissues.timecreated<=1495781129 ...
Read now
Unlock full access