计算商品价格的中位数和 90 分位数(P90)。
- 价格为 null 的商品不参与计算。
- 中位数:价格个数为偶数时取中间两个价格的平均值。
- P90 采用线性插值:把非 null 价格从小到大排成
x[0..n-1],位置h = 0.9 × (n − 1),结果为x[⌊h⌋] + (h − ⌊h⌋) × (x[⌊h⌋+1] − x[⌊h⌋])。不要取“最接近的那个值”。
输入
products(product_id, name, category, price, cost, launched_on)
输出
恰好一行,列为 median_price, p90_price。