문제
입력 코드
SELECT
contest_id,
ROUND(COUNT(DISTINCT user_id)/(SELECT COUNT(user_id) FROM Users) * 100, 2) AS percentage
FROM Register
GROUP BY contest_id
ORDER BY percentage DESC, contest_id ASC;
코드 설명
#SELECT #ROUND #COUNT #DISTINCT #GROUP BY #ORDER BY
문제 출처
'SQL' 카테고리의 다른 글
#94. [LeetCode / MySQL] 1193. Monthly Transactions I (0) | 2023.09.20 |
---|---|
#93. [LeetCode / MySQL] 1211. Queries Quality and Percentage (0) | 2023.09.19 |
#91. [LeetCode / MySQL] 1075. Project Employees I (0) | 2023.09.17 |
#90. [LeetCode / MySQL] 1251. Average Selling Price (0) | 2023.09.16 |
#89. [LeetCode / MySQL] 620. Not Boring Movies (0) | 2023.09.15 |