I don't know if this is helpful for anyone else but I managed to get this query to count our SMART Targets:
SELECT crs.fullname AS 'Course Name', COUNT(s.report_id) AS 'SMART Target'
FROM mdl_course AS crs, mdl_block_ilp_entry AS s, mdl_YOUR_ENROLMENT_TABLE AS e, mdl_user AS u
WHERE e.user = u.idnumber
AND u.id = s.user_id
AND s.report_id = 2
AND e.course = crs.shortname
AND crs.fullname LIKE '%Tutorial%'
GROUP BY crs.fullname
In our set-up, the SMART targets are defined as Report_ID 2 in mdl_block_ilp_entry and all of our e-ILP blocks are attached to courses called "Tutorial". Obviously your enrolment table will have a different name to ur and possibly different values, but this could be a starting point for you. YMMV