Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    Practice problems / Most popular course

    Most popular course

    Easysqljoingroup bysubquery

    Return the title of the course (or courses, on a tie) with the most enrollments, sorted by title. Courses without enrollments don't count. With no enrollments at all, return nothing.

    Tables

    • courses (id INTEGER, title TEXT)
    • enrollments (student_id INTEGER, course_id INTEGER)

    Example 1

    courses

    idtitle
    1JavaScript
    2Python
    3SQL

    enrollments

    student_idcourse_id
    11
    21
    32
    41
    52

    Expected result

    title
    JavaScript

    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: courses, enrollments
    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.