Building on your LEFT JOIN
You'll now revisit the use of the AVG()
function introduced in a previous course.
Being able to build more than one SQL function into your query will enable you to write compact, supercharged queries.
You will use AVG()
in combination with a LEFT JOIN
to determine the average gross domestic product (GDP) per capita by region in 2010.
This exercise is part of the course
Joining Data in SQL
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT name, region, gdp_percapita
FROM countries AS c
LEFT JOIN economies AS e
-- Match on code fields
___
-- Filter for the year 2010
___;