परिणामों की सफाई
पहले बनाए गए Scandinavian पुरस्कारों के ब्रेकडाउन पर लौटते हुए, आप परिणामों को साफ करना चाहते हैं और null मानों को अर्थपूर्ण टेक्स्ट से बदलना चाहते हैं.
यह अभ्यास पाठ्यक्रम का हिस्सा है
PostgreSQL Summary Stats और Window Functions
अभ्यास निर्देश
Countryकॉलम केnullमानों कोAll countriesमें औरGenderकॉलम केnullमानों कोAll gendersमें बदलें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
SELECT
-- Replace the nulls in the columns with meaningful text
___(Country, ___) AS Country,
___(Gender, ___) AS Gender,
COUNT(*) AS Awards
FROM Summer_Medals
WHERE
Year = 2004
AND Medal = 'Gold'
AND Country IN ('DEN', 'NOR', 'SWE')
GROUP BY ROLLUP(Country, Gender)
ORDER BY Country ASC, Gender ASC;