Recap - Scooter Shop
CoddyのSQLジャーニー「基礎」セクションの一部 — レッスン 41/72。
チャレンジ
簡単利用可能なテーブルと列:
<strong>scooters</strong>:<strong>model</strong>,<strong>brand</strong>,<strong>has_lights</strong>,<strong>price</strong>
スクーターショップのマネージャーとして、多くのスクーターがオリジナルではなく、モデル名が欠けていることに気づきました。また、悪いスクーターには通常ライトがありません。
あなたのタスクは2つのステップからなります:
- まず、ショップ内のすべてのスクーターの価格に全体の平均価格を追加します。
- 次に、各
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