Get startedGet started for free

Multiple WHERE clauses

You've learned about semi joins in the form of nested subqueries within the WHERE clause of the main query. In this exercise, you'll familiarize yourself with semi join syntax by thinking through and re-ordering the lines of code provided. Note that subqueries are queries in their own right, so they can have a WHERE clause of their own! This is why you see two WHERE statements here.

Your task is to construct a semi join that pulls all records from economies2019 where gross_savings in the economies2015 table were below the 2015 global average. The global average gross_savings in 2015 was 22.5, and is already pre-calculated in the lines of code provided.

This exercise is part of the course

Joining Data in SQL

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise