• Skip to primary navigation
  • Skip to content
  • Skip to footer
Thomas Ngo Thomas Ngo
  • Home
  • Journal
  • Tags
  • About

    Thomas Ngo

    Software Engineer

    • Stanton, California
    • Email
    • GitHub
    • Resume

    SQL problem - Percentage of Users Attended a Contest

    February 12, 2024 less than 1 minute read

    Page Navigation

    • Problem
    • Query

    Problem

    problem-1633

    Query

    SELECT
        r.contest_id,
        ROUND((COUNT(*) / (SELECT COUNT(*) FROM Users) * 100.00), 2) AS percentage
    FROM
        Register AS r
    GROUP BY
        r.contest_id
    ORDER BY
        percentage DESC,
        r.contest_id ASC
    

    Tags: SQL

    Updated: February 12, 2024

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    You may also enjoy

    Problem of The Day: Reorder Routes to Make All Paths Lead to the City Zero

    January 6, 2026 1 minute read

    Problem Statement

    Problem of The Day: Number of Provinces

    January 3, 2026 1 minute read

    Problem Statement

    Problem of The Day: Keys and Rooms

    January 3, 2026 less than 1 minute read

    Problem Statement

    Problem of The Day: Delete Node in a BST

    January 3, 2026 2 minute read

    Problem Statement

    • Follow:
    • GitHub
    • LinkedIn
    © 2026 Thomas Ngo.