You are on page 1of 1

Filtering data with criteria exercises - SOLUTIONS

Use the ‘world’ sample database to complete these queries:

1. Show all countries in North America. Order alphabetically.

select Name, Continent


from country
where Continent="North America"
order by Name

2. Show all countries in either North or South America. Order by continent then by country
name.

select Name, Continent


from country
where Continent="North America" or Continent="South America"
order by Continent, Name

3. Show all countries who became independent in either 1960 or 1961. Show all of the 1960
countries first, then the 1961 countries.

select Name, IndepYear


from country
where IndepYear=1960 or IndepYear=1961
order by IndepYear

4. Show all African countries that are republics.

select Name, GovernmentForm


from country
where Continent="Africa" and GovernmentForm="Republic"

You might also like