ComenzarEmpieza gratis

Count and count distinct

By pure numbers, the greater a country's population, the greater the pool of athletes and thus Olympians. You decide to look at Olympic medals based purely on population, or volume of available athletes.

The World Bank data shows that in 2016, the countries with the highest populations were China (1,378,665,000), India (1,324,171,354), and the United States of America (323,405,935).

Now you will look at the Olympic athletes' data from the 2016 Summer Olympics to see if China, India, and the USA did indeed win the most medals.

Este ejercicio forma parte del curso

Improving Query Performance in PostgreSQL

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

SELECT ___
  , ___(___) as medals_count
FROM athletes_recent
WHERE medal IS NOT NULL
AND year = 2016
___ ___
ORDER BY medals_count DESC;
Editar y ejecutar código