Recap - Bar Beverage Container
Coddy SQL 여정의 기초 섹션에 포함된 레슨 — 72개 중 29번째.
챌린지
쉬움사용 가능한 테이블 및 컬럼:
<strong>beverages</strong>:<strong>id</strong>,<strong>current_year</strong>,<strong>expiration_year</strong>
당신의 바에는 다양한 주스들이 재고로 쌓여 있으며, 주의를 요하는 것들을 식별해야 합니다. 다음 명확한 기준에 따라 이러한 주스들을 식별하고 정렬하세요:
Old Expired Juices- 만료 연도가 현재 연도보다 6년 이상 이전인 주스들 (
current_year - expiration_year > 6) - 이것들은 즉시 재활용해야 합니다
- 만료 연도가 현재 연도보다 6년 이상 이전인 주스들 (
Almost Expired Juices- 현재 연도에 만료되는 주스들
- OR 내년에 만료되는 주스들 (
expiration_year = current_year + 1) - 이것들은 갱신을 위해 보내야 합니다
다음 단계를 따르세요:
- 이 기준 중 하나를 충족하는 주스들의 ID를 추출하세요
- ID 컬럼을 'to_renew'로 이름 변경하세요
- 처리 우선순위에 따라 결과를 정렬하세요:
- 가장 긴급한 것부터 (가장 오래된 만료 주스들)
- 그 다음 거의 만료된 주스들
- 정렬에 (current_year - expiration_year)를 사용하세요
직접 해보기
기초의 모든 레슨
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