Back to problems

Calculate the Median House Price in Each City

SQL · Airbnb · Medium

For each city that appears in house_prices, compute the median of all recorded price observations for that city. A city may have either an odd or an even number of observations. The input table house_prices has the following schema: Column Type Description observation_id INTEGER Unique identifier for one observation; primary key city TEXT Non-null city name price NUMERIC(14,2) Non-null, nonnegative recorded price Every row represents one distinct observation. Rows with the…

Checking your access…