Top, middle, and bottom thirds
Splitting your data into thirds or quartiles is often useful to understand how the values in your dataset are spread. Getting summary statistics (averages, sums, standard deviations, etc.) of the top, middle, and bottom thirds can help you determine what distribution your values follow.
Bu egzersiz, kursun bir parçasıdır
PostgreSQL Summary Stats and Window Functions
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
WITH Athlete_Medals AS (
SELECT Athlete, COUNT(*) AS Medals
FROM Summer_Medals
GROUP BY Athlete
HAVING COUNT(*) > 1)
SELECT
Athlete,
Medals,
-- Split athletes into thirds by their earned medals
___ ___ ___ AS Third
FROM Athlete_Medals
ORDER BY Medals DESC, Athlete ASC;