Comparing joins
In this exercise, you'll examine how results can differ when performing a full join compared to a left join and inner join by joining the countries
and currencies
tables. You'll be focusing on the North American region
and records where the name
of the country is missing.
You'll begin with a full join with countries
on the left and currencies
on the right. Recall the workings of a full join with the diagram below!
You'll then complete a similar left join and conclude with an inner join, observing the results you see along the way.
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 AS country, code, region, basic_unit
FROM countries
-- Join to currencies
___
USING (code)
-- Where region is North America or name is null
WHERE ___
ORDER BY region;