Get Started

Chaining FULL JOINs

As you have seen in the previous chapter on INNER JOIN, it is possible to chain joins in SQL, such as when looking to connect data from more than two tables.

Suppose you are doing some research on Melanesia and Micronesia, and are interested in pulling information about languages and currencies into the data we see for these regions in the countries table. Since languages and currencies exist in separate tables, this will require two consecutive full joins involving the countries, languages and currencies tables.

This is a part of the course

“Joining Data in SQL”

View Course

Exercise instructions

  • Complete the FULL JOIN with countries as c1 on the left and languages as l on the right, using code to perform this join.
  • Next, chain this join with another FULL JOIN, placing currencies on the right, joining on code again.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

SELECT 
	c1.name AS country, 
    region, 
    l.name AS language,
	basic_unit, 
    frac_unit
FROM countries as c1 
-- Full join with languages (alias as l)
___ 
-- Full join with currencies (alias as c2)
___ 
WHERE region LIKE 'M%esia';
Edit and Run Code