This query fetches the courses that are the most finished (result in descending order by number of completions, i.e. plays with a progress = 100)

Query

select
    trackings.course as course_id,
    courses.name as course_name,
    count(distinct trackings.user) as nb_learners
from qwnogpy_ww21770_datasharing.core.courses_trackings trackings
left join qwnogpy_ww21770_datasharing.core.courses courses
    on trackings.course = courses.id
where trackings.progress =100
group by 1, 2
order by nb_learners desc

Description