O comando SQL a seguir gera a lista das atividades do tipo rótulo de um determinado curso.
SELECT cm.id AS moduleid,l.id AS labelid,l.name,l.intro,cs.name AS sectionname,cs.summary AS sectionsummary FROM mdl_label l INNER JOIN mdl_course c ON c.id=l.course INNER JOIN mdl_course_modules cm ON cm.instance=l.id INNER JOIN mdl_modules m ON m.id=cm.module INNER JOIN mdl_course_sections cs ON cm.section=cs.id WHERE m.name='label' AND l.course=c.id AND cs.course= c.id AND c.id=?
Passe o parâmetro id do curso em c.id=?