Menu
Coddy logo textTech

Recap - Scooter Shop

Part of the Fundamentals section of Coddy's SQL journey — lesson 41 of 72.

challenge icon

Challenge

Easy

Available tables and columns:

  • <strong>scooters</strong>: <strong>model</strong>, <strong>brand</strong>, <strong>has_lights</strong>, <strong>price</strong>

As the manager of a scooter shop, you have noticed that many scooters are not original, meaning they are missing a model name. Furthermore, bad scooters typically do not have lights.

Your task involves two steps:

  1. First, Add to all scooter prices in the shop the overall average price.
  2. Then, Calculate the average price for each brand, considering only good and original scooters (i.e., scooters with a model name and lights).

The result should include the brand and the average price - avg_price. Sort the results by the average price in ascending order.

Try it yourself

All lessons in Fundamentals