• List the names of countries with with a life expectancy below 60.
SELECT Name FROM Country WHERE LifeExpectancy < 60;
  • Using the IN clause, list the names of countries in the Caribbean or Polynesia regions.
SELECT Name FROM Country WHERE Region IN ('Caribbean','Polynesia');

  • List the countries in ANY of the "Europe" Regions (Use the LIKE pattern match regions with "Europe" in the region name).
SELECT Name FROM Country WHERE Region LIKE "%Europe%";

  • List the countries with between 100,000 and 1,000,000 square miles of surface area.
SELECT Name FROM Country WHERE SurfaceArea BETWEEN 100000 AND 1000000

  • List the countries with between 100,000 and 1,000,000 square miles of surface area where the official language is Spanish.
SELECT Name FROM Country, CountryLanguage WHERE SurfaceArea BETWEEN 100000 AND 1000000 AND Country.Code = CountryCode AND IsOfficial = 'T' AND Language = 'Spanish';

  • List the distinct languages that are official but have less than 50% of a countries citizens as speakers.
SELECT DISTINCT Language FROM CountryLanguage WHERE IsOfficial = 'T' AND Percentage < 50;
Topic revision: r1 - 2013-10-21 - JimSkon
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback