• What is the average population of all the counties in the world?
SELECT AVG(Population) FROM Country

  • List the name and continent with the largest population. With the smallest population.
SELECT Name, Continent FROM Country WHERE Population = (SELECT MAX(Population) FROM Country)

  • What is the average life expectancy of the world?
SELECT AVG(LifeExpectancy ) FROM Country

  • List the country name and average life span with the highest and lowest life expectancy.
SELECT Name, LifeExpectancy FROM Country WHERE LifeExpectancy IN (SELECT MAX(LifeExpectancy ) FROM Country)

SELECT Name, LifeExpectancy FROM Country WHERE LifeExpectancy IN (SELECT MIN(LifeExpectancy ) FROM Country)

  • What are the number of distinct governments types?
SELECT COUNT(DISTINCT GovernmentForm ) FROM Country
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