Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    Practice problems / Course completion rate

    Course completion rate

    Mediumsqlgroup bycaseaggregate

    progress holds each learner's percentage (0–100) per course. For each course_id return learners (the count) and completed_pct = the percentage with percent = 100, rounded to one decimal. Sort by course_id.

    Tables

    • progress (student_id INTEGER, course_id INTEGER, percent INTEGER)

    Example 1

    progress

    student_idcourse_idpercent
    11100
    2140
    31100
    1210

    Expected result

    course_idlearnerscompleted_pct
    1366.7
    210

    Constraints

    • 0 ≤ rows ≤ 1000
    • The order of rows matters

    Submit checks your solution against 7 tests, including hidden ones.

    SQL
    -- Write one SELECT query. Tables: progress
    SELECT
    
    Sign in to run
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.