Recap - Scooter Shop
Coddy SQL 여정의 기초 섹션에 포함된 레슨 — 72개 중 41번째.
챌린지
쉬움사용 가능한 테이블 및 열:
<strong>scooters</strong>:<strong>model</strong>,<strong>brand</strong>,<strong>has_lights</strong>,<strong>price</strong>
스쿠터 상점의 매니저로서, 많은 스쿠터가 원본이 아니라는 것을 발견했습니다. 즉, 모델 이름이 누락되어 있습니다. 게다가 품질이 낮은 스쿠터는 일반적으로 조명이 없습니다.
이 작업은 두 단계로 이루어집니다:
- 먼저, 상점의 모든 스쿠터 가격에 전체 평균 가격을 더합니다.
- 그런 다음, 각
brand에 대해 좋은 원본 스쿠터(즉, 모델 이름과 조명이 있는 스쿠터)만 고려하여 평균 가격을 계산합니다.
결과는 brand와 평균 가격 - avg_price를 포함해야 합니다. 결과를 평균 가격 오름차순으로 정렬합니다.
직접 해보기
기초의 모든 레슨
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