You've got it, EXCEPT...
Just as you were able to leverage INTERSECT
to find the names of cities with the same names as countries, you can also do the reverse, using EXCEPT
.
In this exercise, you will find the names of cities that do not have the same names as their countries.
This exercise is part of the course
Joining Data in SQL
Exercise instructions
- Return all cities that do not have the same
name
as a country.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- Return all cities that do not have the same name as a country
___
ORDER BY name;