SQL organised around questions, not syntax
Each row is a used-car listing with fields including model, year, listed selling price, kilometres driven, fuel, seller type, transmission, ownership, mileage, engine, power, torque and seats.
The analysis starts with practical market questions and then selects the SQL needed to answer them. That keeps the work closer to an analyst’s workflow than a collection of disconnected query examples.
The dataset records listings and asking prices. It does not prove completed transactions, revenue or causal market effects.
From segments to movement within a model
Fuel and ownership
Compare average listed price for first-owner manual vehicles by fuel type.
Larger vehicles
Identify high-mileage models among vehicles with more than five seats.
Within-model variation
Find models with a large gap between minimum and maximum listed price.
Price near average
Isolate listings within ten percent of the dataset-wide mean.
Other questions examine above-average price combined with below-average mileage, cumulative listed value by model year, price decreases relative to the previous observation and total recorded kilometres by transmission type.
Increasing complexity only when the question needs it
The running average is documented accurately as cumulative or expanding. Although an original comment called it an exponential moving average, the SQL applies equal weight to all preceding rows and is therefore not a true EMA.
Caveats kept beside the analysis
Large price spreads within a model may reflect different years, trims, condition or specification. A price decline relative to the previous ordered row is an observation within the listing data, not proof of depreciation.
The final ranking query also has a known limitation: partitioning by model ranks within each model rather than isolating the three highest-priced models overall. Calling that out is more useful than presenting an incorrect top-three claim.
A clear route from exercise to fuller model
Natural next steps include normalising vehicle, model, seller and specification entities; adding manufacturer-level analysis; implementing a true EMA; and correcting the global top-three ranking.
Data-quality checks for missing, duplicated or inconsistent attributes would strengthen the import layer, while Power BI could make the verified query outputs easier to explore.