SELECT weight_pounds, state, year, gestation_weeks
ORDER BY weight_pounds DESC
This is one of my favorite related queries (it's a two-parter)...
First, what is the average baby weight plus some N * standard deviation (in the case below, 4x). In other words, what is average baby weight 4 standard deviations above the mean?
(AVG(weight_pounds) + STDDEV(weight_pounds) * 4)
Using this information, one can see which states and which months have the most babies born heavier that 4 standard deviations from average.
SELECT state, year, month ,COUNT(*) AS outlier_count
(weight_pounds > 12.721342001626912)
(state != '' AND state IS NOT NULL)
GROUP BY state, year, month
ORDER BY outlier_count DESC;