Recap - Creatures
Coddy SQL 여정의 기초 섹션에 포함된 레슨 — 72개 중 70번째.
챌린지
중급사용 가능한 테이블과 컬럼:
<strong>creatures</strong>:<strong>creature_name</strong>,<strong>preference</strong>,<strong>has_legs</strong>
이 챌린지에서, 중요한 짝을 찾고자 하는 생물들이 있습니다. 우리는 그들이 매치를 찾도록 도와야 합니다.
각 생물은 선호도 값과 다리를 가지고 있거나 가지지 않은 상태를 가집니다.
규칙:
- 생물들은 동일한
has_legs값을 공유하는 다른 생물들과만 매칭됩니다 - 각 그룹 내(
has_legstrue/false)에서, 선호도에 따라 생물들을 정렬합니다 NTILE(total_creature_count/2)를 사용하여couple_matcher번호를 할당합니다- 두 그룹 모두 동일한
couple_matcher범위(1에서 N까지)를 사용합니다
예시: 총 10마리의 생물(다리 있는 6마리, 없는 4마리)
- 다리 있는 생물: 선호도에 따라 랭킹,
couple_matcher1-5 할당 - 다리 없는 생물: 선호도에 따라 랭킹,
couple_matcher1-5 할당 - 결과: 여러 개의 별도 커플이 동일한
couple_matcher번호를 가질 수 있습니다
직접 해보기
기초의 모든 레슨
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 columns