Recap - RANK & DENSE_RANK
Coddy SQL 여정의 기초 섹션에 포함된 레슨 — 72개 중 66번째.
챌린지
중급사용 가능한 테이블 및 컬럼:
<strong>medals</strong>:<strong>region</strong>,<strong>medal_color</strong>,<strong>medal_count</strong>
지역은 대회에서 메달을 받습니다. 다음을 보여주는 보고서를 생성하세요:
- 각 지역에 대해 계산:
total_medals: 그들이 가진 모든 메달의 합계rank_by_medals: total_medals를 기준으로 오름차순 dense rank 생성 (메달이 적은 지역이 더 나은/낮은 순위를 받음)
- 결과를 다음에 의해 정렬:
rank_by_medals(오름차순)region(알파벳 순)
반환:
regiontotal_medalsrank_by_medals
직접 해보기
기초의 모든 레슨
4More Keywords
The IN keywordThe BETWEEN keywordThe LIKE keywordThe AS keywordRecap - Cellphone Models2Conditions
Conditions BasicsThe AND keywordThe OR keywordThe NOT keywordMultiple Conditions CombinedParenthesisBooleans5Arithmetic Operations
Mathematical OperatorsMathematical ColumnsThe Modulo OperationThe ROUND() Function3Specific Return Format
Null valuesSort Results Part 1Sort Results Part 2Recap - Cyber Security FirmLimit number of recordsRecap - Vehicle Factory6Intro Challenges
Recap - Parliamentary ElectionRecap - Police Criminal ArrestRecap - Bar Beverage ContainerRecap - Engineer new columns9Multiple tables
Basic Join Part 1Basic Join Part 2Recap - JoinSelf joinRecap - Self JoinUnionSimplify queries, WITH keywordRecap - With QueriesRecap - Real Estate Contractor12Window Functions part 2
RANK & DENSE_RANK FunctionsRecap - RANK & DENSE_RANKNTILE FunctionAggregation FunctionsROWS & RANGE Criterion