ComenzarEmpieza gratis

Countries with subqueries or CTEs

Of the Olympic regions, Africa has the warmest winters. However, some African countries do participate in the Winter Olympics. For instance, Morocco has sent more than 20 athletes over the years. Perhaps looking at the data at the regional level is too broad. Maybe some African countries have colder winters than other African countries.

Take another look at winter climate data, but look on a country level. The athletes have been filtered down to include only African athletes, with the first African Olympians competing in 1960.

Use both a subquery and CTE structure and compare the results.

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.

-- Climate by country with Olympian athletes
SELECT country
  , temp_06
  , precip_06
FROM climate
WHERE region = 'Africa'
AND olympic_cc IN (___ ___ ___ FROM ___)
ORDER BY temp_06;
Editar y ejecutar código