Trimmed Mean per Country

medium
Unit 13 · Window Functions VI0/2 to milestone

Averages are skewed by one huge or tiny order. For each country with at least 3 orders, drop its single smallest and single largest order (by total, ties by id) and average the rest. Return country, trimmed_mean (rounded to 2 decimal places) and orders_used, sorted by country.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
query.sql · SQLite
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Trimmed Mean per Country · TechGradify