SELECT p.name,COUNT(DISTINCT DATE(t.transaction_date)) sale_days,AVG(tsl.quantity) avg_daily_demand,STDDEV(tsl.quantity) demand_variability FROM products p JOIN transaction_sell_lines tsl ON p.id=tsl.product_id JOIN transactions t ON tsl.transaction_id=t.id WHERE t.type="sell" GROUP BY p.id,p.name ORDER BY demand_variability DESC;